lua/wrappers/game/lua_character.cpp
/**
	 * Returns the item equipped at the given body part.
	 *
	 * @param string part_name The body part to get the item from.
	 * @returns am.item The item equipped, nil if there was no item equipped
	 * or if there was not body part with 'part_name' found.
	 */
Returns the item equipped at the given body part.
@param string part_name The body part to get the item from.
@returns am.item The item equipped, nil if there was no item equipped
or if there was not body part with 'part_name' found.
Returns the item equipped at the given body part . @param string part_name The body part to get the item from . @returns am . item The item equipped nil if there was no item equipped or if there was not body part with ' part_name ' found .
int Character_equipped(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			const char *partName = nullptr;
			if (lua_isstr(lua, 2))
			{
				partName = lua_tostring(lua, 2);
			}
			else
			{
				BodyPart *part = castUData<BodyPart>(lua, 2);
				if (part)
				{
					partName = part->getName();
				}
			}
			if (partName)
			{
				base::Handle<Item> item(obj->getEquipped(lua_tostring(lua, 2)));
				if (item)
				{
					wrapRefObject<Item>(lua, item);
					return 1;
				}
			}
			return LuaState::expectedArgs(lua, "equipped", 2, "am.body_part part", "string part_name");
		}
		return LuaState::expectedContext(lua, "equipped", "am.character");
	}
int Character_equipped ( lua_State * lua ) { Character * obj = castUData < Character > ( lua , 1 ) ; if ( obj ) { const char * partName = nullptr ; if ( lua_isstr ( lua , 2 ) ) { partName = lua_tostring ( lua , 2 ) ; } else { BodyPart * part = castUData < BodyPart > ( lua , 2 ) ; if ( part ) { partName = part -> getName ( ) ; } } if ( partName ) { base :: Handle < Item > item ( obj -> getEquipped ( lua_tostring ( lua , 2 ) ) ) ; if ( item ) { wrapRefObject < Item > ( lua , item ) ; return 1 ; } } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Returns the item equipped at the given body part.
Returns the item equipped at the given body part .