mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 23:01:14 +00:00
fixup! Support location_id in [recall] and [unstore_unit]
(cherry-picked from commit ea6578a87a4806500ec482cd179c565019c548fb)
This commit is contained in:
parent
48123469bc
commit
6d322cf63c
@ -495,9 +495,14 @@ WML_HANDLER_FUNCTION(recall,, cfg)
|
||||
const unit_ptr to_recruit = *u;
|
||||
const unit* pass_check = to_recruit.get();
|
||||
if(!cfg["check_passability"].to_bool(true)) pass_check = nullptr;
|
||||
const map_location cfg_loc = cfg.has_attribute("location_id")
|
||||
? resources::gameboard->map().special_locations().left[cfg["location_id"]]
|
||||
: cfg_to_loc(cfg);
|
||||
map_location cfg_loc = cfg_to_loc(cfg);
|
||||
if(cfg.has_attribute("location_id")) {
|
||||
const auto& special_locs = resources::gameboard->map().special_locations().left;
|
||||
auto& iter = special_locs.find(cfg["location_id"])
|
||||
if(iter != special_locs.end()) {
|
||||
cfg_loc = iter->second;
|
||||
}
|
||||
}
|
||||
|
||||
/// @todo fendrin: comment this monster
|
||||
for (unit_map::const_unit_iterator leader : leaders) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user