Support primary_attack and secondary_attack in wesnoth.game_events.fire

These are taken as synonyms of the actual internal tag names, [first] and [second]. So, first is interchangeable with primary_attack and second is interchangeable with secondary_attack.
This commit is contained in:
Celtic Minstrel 2022-06-22 09:41:29 -04:00 committed by Celtic Minstrel
parent 8eb7a70a63
commit 501936affb

View file

@ -633,6 +633,16 @@ int game_lua_kernel::intf_fire_event(lua_State *L, const bool by_id)
luaW_toconfig(L, pos, data);
// Support WML names for some common data
if(data.has_child("primary_attack")) {
data.add_child("first", data.child("primary_attack"));
data.remove_children("primary_attack");
}
if(data.has_child("secondary_attack")) {
data.add_child("second", data.child("secondary_attack"));
data.remove_children("secondary_attack");
}
bool b = false;
if (by_id) {