mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-27 07:17:19 +00:00
introduced [recall]fire_event=yes|no (default no) parameter
(fixes bug #17083)
This commit is contained in:
parent
2b90cd1ed3
commit
aa311fd68a
@ -14,6 +14,7 @@ Version 1.9.2+svn:
|
||||
* Converted some dialog boxes to GUI2
|
||||
* WML Engine:
|
||||
* Created tag [petrify] (bug #17077). Moved [unpetrify] to lua.
|
||||
* Introduced [recall]fire_event=yes|no (default no) parameter (fixes bug #17083).
|
||||
|
||||
Version 1.9.2:
|
||||
* Campaigns:
|
||||
|
@ -404,7 +404,7 @@ std::string find_recruit_location(int side, map_location &recruit_loc, bool need
|
||||
}
|
||||
|
||||
void place_recruit(const unit &u, const map_location &recruit_location,
|
||||
bool is_recall, bool show, bool full_movement,
|
||||
bool is_recall, bool show, bool fire_event, bool full_movement,
|
||||
bool wml_triggered)
|
||||
{
|
||||
LOG_NG << "placing new unit on location " << recruit_location << "\n";
|
||||
@ -425,8 +425,10 @@ void place_recruit(const unit &u, const map_location &recruit_location,
|
||||
|
||||
if (is_recall)
|
||||
{
|
||||
LOG_NG << "firing prerecall event\n";
|
||||
game_events::fire("prerecall",recruit_location);
|
||||
if (fire_event) {
|
||||
LOG_NG << "firing prerecall event\n";
|
||||
game_events::fire("prerecall",recruit_location);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -451,8 +453,10 @@ void place_recruit(const unit &u, const map_location &recruit_location,
|
||||
}
|
||||
if (is_recall)
|
||||
{
|
||||
LOG_NG << "firing recall event\n";
|
||||
game_events::fire("recall",recruit_location);
|
||||
if (fire_event) {
|
||||
LOG_NG << "firing recall event\n";
|
||||
game_events::fire("recall",recruit_location);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ std::string find_recruit_location(int side, map_location &recruit_location,
|
||||
* through a call to recruit_location().
|
||||
*/
|
||||
void place_recruit(const unit &u, const map_location &recruit_location,
|
||||
bool is_recall, bool show = false, bool full_movement = false,
|
||||
bool is_recall, bool show = false, bool fire_event = true, bool full_movement = false,
|
||||
bool wml_triggered = false);
|
||||
|
||||
/** Structure describing the statistics of a unit involved in the battle. */
|
||||
|
@ -1638,7 +1638,7 @@ WML_HANDLER_FUNCTION(recall, /*event_info*/, cfg)
|
||||
unit to_recruit(*u);
|
||||
avail.erase(u); // Erase before recruiting, since recruiting can fire more events
|
||||
find_recruit_location(index + 1, loc, false);
|
||||
place_recruit(to_recruit, loc, true, cfg["show"].to_bool(true), true, true);
|
||||
place_recruit(to_recruit, loc, true, cfg["show"].to_bool(true), cfg["fire_event"].to_bool(false), true, true);
|
||||
unit_recalled = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user