Skip to content

Commit

Permalink
Fix wesnoth.set_village_owner ignoring the fire_event parameter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CelticMinstrel committed Feb 17, 2018
1 parent 1196225 commit 0dfb390
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripting/game_lua_kernel.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 0dfb390

Please sign in to comment.