Instead of forcefully checking for terrain,
introduced [unstore_unit]ignore_passability= (def no) key as in [teleport]. Only in effect if find_vacant=yes.
This commit is contained in:
parent
8d91c8a727
commit
5ed4f8074b
1 changed files with 7 additions and 5 deletions
|
@ -2026,12 +2026,14 @@ WML_HANDLER_FUNCTION(unstore_unit, /*event_info*/, cfg)
|
|||
(cfg.has_attribute("x") && cfg.has_attribute("y")) ? cfg : vconfig(var));
|
||||
if(loc.valid()) {
|
||||
if (cfg["find_vacant"].to_bool()) {
|
||||
const unit* pass_check = &u;
|
||||
if (cfg["ignore_passability"].to_bool(false)) pass_check = 0;
|
||||
loc = pathfind::find_vacant_tile(
|
||||
*resources::game_map,
|
||||
*resources::units,
|
||||
loc,
|
||||
pathfind::VACANT_ANY,
|
||||
&u);
|
||||
*resources::game_map,
|
||||
*resources::units,
|
||||
loc,
|
||||
pathfind::VACANT_ANY,
|
||||
pass_check);
|
||||
}
|
||||
|
||||
resources::units->erase(loc);
|
||||
|
|
Loading…
Add table
Reference in a new issue