diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index d925f4b6b..b8f607c87 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -92,7 +92,7 @@ DFhackCExport command_result df_getplants (Core * c, vector & parameter bool dirty = false; for (size_t j = 0; j < cur->plants.size(); j++) { - const df::plant *plant = cur->plants[i]; + const df::plant *plant = cur->plants[j]; int x = plant->pos.x % 16; int y = plant->pos.y % 16; if (plantIDs.find(plant->material) != plantIDs.end())