fix unit:to_map(loc) #8229
lua_unit::put_map already removes the unit previously on that tile, and doing it here causes an error when the unit was on that tile already.
This commit is contained in:
parent
34c8753878
commit
8039781676
1 changed files with 1 additions and 1 deletions
|
@ -2530,7 +2530,6 @@ void game_lua_kernel::put_unit_helper(const map_location& loc)
|
|||
game_display_->invalidate(loc);
|
||||
}
|
||||
|
||||
units().erase(loc);
|
||||
resources::whiteboard->on_kill_unit();
|
||||
}
|
||||
|
||||
|
@ -2581,6 +2580,7 @@ int game_lua_kernel::intf_put_unit(lua_State *L)
|
|||
}
|
||||
|
||||
unit_ptr u = unit::create(cfg, true, vcfg);
|
||||
units().erase(loc);
|
||||
put_unit_helper(loc);
|
||||
u->set_location(loc);
|
||||
units().insert(u);
|
||||
|
|
Loading…
Add table
Reference in a new issue