lua/wrappers/game/lua_game_object.cpp
/**
	 * Sets the map that the GameObject is on, can be nil.
	 *
	 * @param am.map map The map to put the GameObject on.
	 * @returns am.GameObject This
	 */
Sets the map that the GameObject is on, can be nil.
@param am.map map The map to put the GameObject on.
Sets the map that the GameObject is on can be nil . @param am . map map The map to put the GameObject on .
int GameObject_map(lua_State *lua, GameObject *obj)
	{
		if (!obj)
		{
			return 0;
		}
		if (lua_gettop(lua) == 1)
		{
			Map *map = obj->getMap();
			if (map)
			{
				wrapRefObject<Map>(lua, map);
				return 1;
			}
			lua_pushnil(lua);
			return 1;
		}
		else if (lua_isnil(lua, 2))
		{
			obj->setMap(nullptr);
			lua_first(lua);
		}
		else
		{
			Map *map = castUData<Map>(lua, 2);
			if (map)
			{
				obj->setMap(map);
				lua_first(lua);
			}
		}
		return LuaState::expectedArgs(lua, "map", 2, "nil map", "am.map map");
	}
int GameObject_map ( lua_State * lua , GameObject * obj ) { if ( ! obj ) { return 0 ; } if ( lua_gettop ( lua ) == 1 ) { Map * map = obj -> getMap ( ) ; if ( map ) { wrapRefObject < Map > ( lua , map ) ; return 1 ; } lua_pushnil ( lua ) ; return 1 ; } else if ( lua_isnil ( lua , 2 ) ) { obj -> setMap ( nullptr ) ; lua_first ( lua ) ; } else { Map * map = castUData < Map > ( lua , 2 ) ; if ( map ) { obj -> setMap ( map ) ; lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; }
Sets the map that the GameObject is on, can be nil.
Sets the map that the GameObject is on can be nil .
// Can be set to nil