lua/wrappers/game/lua_engine.cpp
/**
	 * @static
	 * Registers a game object with the current game so that it can be
	 * looked up from anywhere. This is just shorthand for getting
	 * the current game and registering the game object with that.
	 * @param am.game_object game_object The game object to register with the game engine.
	 */
@static
Registers a game object with the current game so that it can be
looked up from anywhere. This is just shorthand for getting
the current game and registering the game object with that.
@param am.game_object game_object The game object to register with the game engine.
@static Registers a game object with the current game so that it can be looked up from anywhere . This is just shorthand for getting the current game and registering the game object with that . @param am . game_object game_object The game object to register with the game engine .
int Engine_register_game_object(lua_State *lua)
	{
		GameObject *obj = castUData<Character>(lua, 1);
		if (!obj)
		{
			obj = castUData<Item>(lua, 1);
		}
		if (obj)
		{
			if (!Engine::getEngine()->registerGameObject(obj))
			{
				std::stringstream ss;
				ss << "Unable to register game object: ";
				LuaState::printTypeValue(lua, 2, ss, true);
				ss << " (" << obj->getName() << " does not have a game id";
				LuaState::warning(lua, ss.str().c_str());
			}
			return 0;
		}
		return LuaState::expectedArgs(lua, "@register_game_object", "am.game_object object");
	}
int Engine_register_game_object ( lua_State * lua ) { GameObject * obj = castUData < Character > ( lua , 1 ) ; if ( ! obj ) { obj = castUData < Item > ( lua , 1 ) ; } if ( obj ) { if ( ! Engine :: getEngine ( ) -> registerGameObject ( obj ) ) { std :: stringstream ss ; ss << " " ; LuaState :: printTypeValue ( lua , 2 , ss , true ) ; ss << " " << obj -> getName ( ) << " " ; LuaState :: warning ( lua , ss . str ( ) . c_str ( ) ) ; } return 0 ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; }
@static
 Registers a game object with the current game so that it can be
 looked up from anywhere.
@static Registers a game object with the current game so that it can be looked up from anywhere .