createitem: fix an issue with items teleporting to the location of another 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 #1198
develop
lethosor 2017-12-16 16:04:32 -05:00
parent ad2c939fea
commit b1e77fa260
1 changed files with 2 additions and 2 deletions

@ -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)