Erased target location before moving a unit. (Fix for bug #16391.)

This commit is contained in:
Guillaume Melquiond 2010-08-09 20:41:33 +00:00
parent 1179fbbca3
commit d41e8cfeec

View file

@ -1847,7 +1847,8 @@ static int intf_put_unit(lua_State *L)
u = lu->get();
if (!u) return luaL_argerror(L, unit_arg, "unit not found");
if (lu->on_map()) {
if (unit_arg == 1) return 0;
if (unit_arg == 1 || u->get_location() == loc) return 0;
resources::units->erase(loc);
resources::units->move(u->get_location(), loc);
return 0;
} else if (int side = lu->on_recall_list()) {