diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 3fd09396baa45..d38811d95b3e3 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -1671,7 +1671,7 @@ int game_lua_kernel::intf_end_turn(lua_State* L) //but the later will make the turn counter change aswell fire turn end events accoringly etc. if (!lua_isnoneornil(L, 1)) { int npn = luaL_checkinteger(L, 1); - if (npn <= 0 /*TODO: || npn > 2*nteams*/) { + if (npn <= 0 || npn > 2 * teams().size()) { return luaL_argerror(L, 1, "side number out of range"); } resources::controller->gamestate().next_player_number_ = npn;