lua/wrappers/game/lua_game.cpp
/**
	 * Sets the generic dead graphic asset name to nil.
	 *
	 * @param nil grapic Sets to nil.
	 * @returns am.game This
	 */
Sets the generic dead graphic asset name to nil.
@param nil grapic Sets to nil.
Sets the generic dead graphic asset name to nil . @param nil grapic Sets to nil .
int Game_generic_dead_graphic(lua_State *lua)
	{
		Game *game = castUData<Game>(lua, 1);
		if (game)
		{
			if (lua_gettop(lua) == 1)
			{
				gfx::Sprite *dead = game->getGenericDeadGraphic();
				if (dead)
				{
					lua::wrapRefObject<gfx::Sprite>(lua, dead);
				}
				else
				{
					lua_pushnil(lua);
				}
				return 1;
			}
			else
			{
				bool valid = false;
				if (lua_isstr(lua, 2))
				{
					game->setGenericDeadGraphic(new gfx::Sprite(lua_tostring(lua, 2)));
					valid = true;
				}
				else if (lua_isnil(lua, 2))
				{
					game->setGenericDeadGraphic(nullptr);
					valid = true;
				}
				else
				{
					gfx::Sprite *sprite = lua::castUData<gfx::Sprite>(lua, 2);
					if (sprite)
					{
						game->setGenericDeadGraphic(sprite);
						valid = true;
					}
				}
				if (valid)
				{
					lua_first(lua);
				}
				return LuaState::expectedArgs(lua, "generic_dead_graphic", 3, "string asset_name", "Sprite sprite", "nil");
			}
			lua_pushstring(lua, game->getScenarioName());
			return 1;
		}
		return LuaState::expectedContext(lua, "generic_dead_graphic", "am.game");
	}
int Game_generic_dead_graphic ( lua_State * lua ) { Game * game = castUData < Game > ( lua , 1 ) ; if ( game ) { if ( lua_gettop ( lua ) == 1 ) { gfx :: Sprite * dead = game -> getGenericDeadGraphic ( ) ; if ( dead ) { lua :: wrapRefObject < gfx :: Sprite > ( lua , dead ) ; } else { lua_pushnil ( lua ) ; } return 1 ; } else { bool valid = false ; if ( lua_isstr ( lua , 2 ) ) { game -> setGenericDeadGraphic ( new gfx :: Sprite ( lua_tostring ( lua , 2 ) ) ) ; valid = true ; } else if ( lua_isnil ( lua , 2 ) ) { game -> setGenericDeadGraphic ( nullptr ) ; valid = true ; } else { gfx :: Sprite * sprite = lua :: castUData < gfx :: Sprite > ( lua , 2 ) ; if ( sprite ) { game -> setGenericDeadGraphic ( sprite ) ; valid = true ; } } if ( valid ) { lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , 3 , " " , " " , " " ) ; } lua_pushstring ( lua , game -> getScenarioName ( ) ) ; return 1 ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the generic dead graphic asset name to nil.
Sets the generic dead graphic asset name to nil .