Skip to content

Commit

Permalink
[harm_unit]: added fire_event keys to wml_actions.unstore_unit tables
Browse files Browse the repository at this point in the history
Fix for bug #20836
  • Loading branch information
Elvish-Hunter committed Jun 14, 2013
1 parent 6c4f81e commit 664c7e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions data/lua/wml-tags.lua
Expand Up @@ -934,14 +934,20 @@ function wml_actions.harm_unit(cfg)
-- this blocks handles the harmed units advancing
if experience ~= false and harmer and unit_to_harm.valid and unit_to_harm.experience >= unit_to_harm.max_experience then
wml_actions.store_unit { { "filter", { id = unit_to_harm.id } }, variable = "Lua_store_unit", kill = true }
wml_actions.unstore_unit { variable = "Lua_store_unit", find_vacant = false, advance = true }
wml_actions.unstore_unit { variable = "Lua_store_unit",
find_vacant = false,
advance = true,
fire_event = fire_event }
wesnoth.set_variable ( "Lua_store_unit", nil )
end

-- this block handles the harmer advancing
if experience ~= false and harmer and harmer.valid and harmer.experience >= harmer.max_experience then
wml_actions.store_unit { { "filter", { id = harmer.id } }, variable = "Lua_store_unit", kill = true }
wml_actions.unstore_unit { variable = "Lua_store_unit", find_vacant = false, advance = true }
wml_actions.unstore_unit { variable = "Lua_store_unit",
find_vacant = false,
advance = true,
fire_event = fire_event }
wesnoth.set_variable ( "Lua_store_unit", nil )
end
end
Expand Down

0 comments on commit 664c7e6

Please sign in to comment.