lua/wrappers/game/lua_body_part.cpp
/**
	 * Returns the equipped item on this body part.
	 * @returns am.item The equipped item, can be nil.
	 */
Returns the equipped item on this body part.
@returns am.item The equipped item, can be nil.
Returns the equipped item on this body part . @returns am . item The equipped item can be nil .
int BodyPart_item(lua_State *lua)
	{
		BodyPart *part = castUData<BodyPart>(lua, 1);
		if (part)
		{
			if (lua_gettop(lua) == 1) 
			{
				Item *item = part->getEquippedItem();
				if (item)
				{
					wrapRefObject<Item>(lua, item);
					return 1;
				}
				lua_pushnil(lua);
				return 1;
			}
			else
			{
				if (lua_isnil(lua, 2))
				{
					part->setEquippedItem(nullptr);
					lua_first(lua);
				}
				Item *item = castUData<Item>(lua, 2);
				if (item)
				{
					part->setEquippedItem(item);
					lua_first(lua);
				}
			}
			return LuaState::expectedArgs(lua, "item", 2, "am.item item, nil item");
		}
		return LuaState::expectedContext(lua, "item", "am.body_part");
	}
int BodyPart_item ( lua_State * lua ) { BodyPart * part = castUData < BodyPart > ( lua , 1 ) ; if ( part ) { if ( lua_gettop ( lua ) == 1 ) { Item * item = part -> getEquippedItem ( ) ; if ( item ) { wrapRefObject < Item > ( lua , item ) ; return 1 ; } lua_pushnil ( lua ) ; return 1 ; } else { if ( lua_isnil ( lua , 2 ) ) { part -> setEquippedItem ( nullptr ) ; lua_first ( lua ) ; } Item * item = castUData < Item > ( lua , 2 ) ; if ( item ) { part -> setEquippedItem ( item ) ; lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 2 , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Returns the equipped item on this body part.
Returns the equipped item on this body part .
// No args // Two or more args