summaryrefslogtreecommitdiff
path: root/plugins/changevein.cpp
diff options
context:
space:
mode:
authorQuietust2012-03-29 19:05:53 -0500
committerQuietust2012-03-29 19:05:53 -0500
commit6a7e7241b8f3dd80a999d172cfc2572d8f58ec99 (patch)
treedab5ecea6dcd8f4ea35c7e519bf9ae6d11981a92 /plugins/changevein.cpp
parent07bb51946f96006190f34b0057cec29661e18aa2 (diff)
downloaddfhack-6a7e7241b8f3dd80a999d172cfc2572d8f58ec99.tar.gz
dfhack-6a7e7241b8f3dd80a999d172cfc2572d8f58ec99.tar.bz2
dfhack-6a7e7241b8f3dd80a999d172cfc2572d8f58ec99.tar.xz
Fix bug in changevein - if multiple veins overlap the same tile, pick the LAST one rather than the first one
Diffstat (limited to 'plugins/changevein.cpp')
-rw-r--r--plugins/changevein.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/changevein.cpp b/plugins/changevein.cpp
index 5b8d2e98..133d7ef4 100644
--- a/plugins/changevein.cpp
+++ b/plugins/changevein.cpp
@@ -63,10 +63,9 @@ command_result df_changevein (color_ostream &out, vector <string> & parameters)
df::block_square_event *evt = block->block_events[j];
if (evt->getType() != block_square_event_type::mineral)
continue;
- mineral = (df::block_square_event_mineralst *)evt;
- if (mineral->getassignment(tx, ty))
- break;
- mineral = NULL;
+ df::block_square_event_mineralst *cur = (df::block_square_event_mineralst *)evt;
+ if (cur->getassignment(tx, ty))
+ mineral = cur;
}
if (!mineral)
{