lua/wrappers/game/lua_game.cpp
/**
	 * Sets the current active map.
	 *
	 * @param am.map map The map to set as the active map.
	 * @returns am.game This.
	 */
Sets the current active map.
Sets the current active map .
int Game_current_map(lua_State *lua)
	{
		Game *game = castUData<Game>(lua, 1);
		if (game)
		{
			if (lua_gettop(lua) == 1)
			{
				Map *map = game->getCurrentMap();
				if (map)
				{
					wrapRefObject<Map>(lua, map);
					return 1;
				}
				lua_pushnil(lua);
				return 1;
			}
			else
			{
				if (lua_isstr(lua, 2))
				{
					game->setCurrentMap(lua_tostring(lua, 2));
					lua_first(lua);
				}
				else
				{
					Map *map = castUData<Map>(lua, 2);
					if (map)
					{
						game->setCurrentMap(map);
						lua_first(lua);
					}
				}
				return LuaState::expectedArgs(lua, "current_map", 2, "string map_name", "am.map map");
			}
		}
		return LuaState::expectedContext(lua, "currentMap", "am.game");
	}
int Game_current_map ( lua_State * lua ) { Game * game = castUData < Game > ( lua , 1 ) ; if ( game ) { if ( lua_gettop ( lua ) == 1 ) { Map * map = game -> getCurrentMap ( ) ; if ( map ) { wrapRefObject < Map > ( lua , map ) ; return 1 ; } lua_pushnil ( lua ) ; return 1 ; } else { if ( lua_isstr ( lua , 2 ) ) { game -> setCurrentMap ( lua_tostring ( lua , 2 ) ) ; lua_first ( lua ) ; } else { Map * map = castUData < Map > ( lua , 2 ) ; if ( map ) { game -> setCurrentMap ( map ) ; lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; } } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the current active map.
Sets the current active map .