예제 #1
0
static int should_send_sync_message(lua_State* L) {
	GameState* gs = lua_api::gamestate(L);
        lua_pushboolean(L, gs->game_world().should_sync_states() && gs->local_player_data().index == 1);
        // lua_pushboolean(L, false);
        gs->game_world().should_sync_states() = false;
	return 1;
}
예제 #2
0
GameMapState* mapstate(LuaStackValue map_obj, bool defaulted = false) {
    GameState* gs = lua_api::gamestate(map_obj);
    level_id id;
    if (defaulted && map_obj.isnil()) {
        id = gs->get_level_id();
    } else {
        id = map_obj["_id"].to_int();
    }
    return gs->game_world().get_level(id);
}