Skip to content

Commit

Permalink
createitem: fix an issue with items teleporting to the location of an…
Browse files Browse the repository at this point in the history
…other unit

This was due to moveToGround() being called twice, first with the location of
world.units.active[0], which caused the item to teleport to that location later.

Fixes DFHack#1198
  • Loading branch information
lethosor committed Dec 16, 2017
1 parent ad2c939 commit b1e77fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/createitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ bool makeItem (df::reaction_product_itemst *prod, df::unit *unit, bool second_it
if (!Items::moveToBuilding(mc, out_items[i], (df::building_actual *)building, 0))
out_items[i]->moveToGround(building->centerx, building->centery, building->z);
}
if (on_ground)
out_items[i]->moveToGround(unit->pos.x, unit->pos.y, unit->pos.z);
if (move_to_cursor)
out_items[i]->moveToGround(cursor->x, cursor->y, cursor->z);
else if (on_ground)
out_items[i]->moveToGround(unit->pos.x, unit->pos.y, unit->pos.z);
if (is_gloves)
{
// if the reaction creates gloves without handedness, then create 2 sets (left and right)
Expand Down

0 comments on commit b1e77fa

Please sign in to comment.