Fix wesnoth.set_village_owner ignoring the fire_event parameter

Looks like this was lost in the refactor that introduced the luaW_checklocation helper function.
If the location is specified as two separate parameters for x and y, this helper function
actually pops the y parameter from the stack so that further parameter tests can act
as if the location was a single parameter. Thus, the fire_event parameter, which used to
be 4th on the stack, is now moved down to 3rd.
This commit is contained in:
Celtic Minstrel 2018-02-17 01:23:49 -05:00 committed by GitHub
parent 1196225017
commit 0dfb390a84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1178,7 +1178,7 @@ int game_lua_kernel::intf_set_village_owner(lua_State *L)
// If the new side was valid, re-assign the village.
if(new_side) {
new_side->get_village(loc, old_side_num, (luaW_toboolean(L, 4) ? &gamedata() : nullptr));
new_side->get_village(loc, old_side_num, (luaW_toboolean(L, 3) ? &gamedata() : nullptr));
}
return 0;