lua/wrappers/game/lua_item.cpp
/**
	 * Checks if a new body type is on this item.
	 * 
	 * @param string part_type The name of the body part.
	 * @returns boolean True if the body part type was found on this item.
	 */
Checks if a new body type is on this item.

@param string part_type The name of the body part.
@returns boolean True if the body part type was found on this item.
Checks if a new body type is on this item . @param string part_type The name of the body part . @returns boolean True if the body part type was found on this item .
int Item_has_body_type(lua_State *lua)
	{
		Item *item = castUData<Item>(lua, 1);
		if (item)
		{
			if (lua_isstr(lua, 2))
			{
				BodyPartType::PartType type = BodyPartType::getBodyPartType(lua_tostring(lua, 2));
				if (type != BodyPartType::MAX_BODY_TYPE_LENGTH)
				{
					lua_pushboolean(lua, item->hasBodyPartType(type));
					return 1;
				}
				std::stringstream ss;
				ss << "Unknown body part type '" << lua_tostring(lua, 2) << '\'';
				LuaState::warning(lua, ss.str().c_str());
				lua_pushboolean(lua, false);
				return 1;
			}
			return LuaState::expectedArgs(lua, "has_body_type", "string body_type");
		}
		return LuaState::expectedContext(lua, "has_body_type", "am.item");
	}
int Item_has_body_type ( lua_State * lua ) { Item * item = castUData < Item > ( lua , 1 ) ; if ( item ) { if ( lua_isstr ( lua , 2 ) ) { BodyPartType :: PartType type = BodyPartType :: getBodyPartType ( lua_tostring ( lua , 2 ) ) ; if ( type != BodyPartType :: MAX_BODY_TYPE_LENGTH ) { lua_pushboolean ( lua , item -> hasBodyPartType ( type ) ) ; return 1 ; } std :: stringstream ss ; ss << " " << lua_tostring ( lua , 2 ) << ' \' ' ; LuaState :: warning ( lua , ss . str ( ) . c_str ( ) ) ; lua_pushboolean ( lua , false ) ; return 1 ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Checks if a new body type is on this item.
Checks if a new body type is on this item .