lua/wrappers/game/lua_character.cpp
/**
	 * Attempts to add a body part with the given name to the character.
	 * Returns true if this was successful, false if there was
	 * another body part with the same name attached.
	 *
	 * @param string part_name The name of the body part to create and add to the character.
	 * @param string [UNKNOWN_PART] part_type The type of the body part.
	 * @returns boolean If part was added successfully.
	 */
Attempts to add a body part with the given name to the character.
Returns true if this was successful, false if there was
another body part with the same name attached.

@param string part_name The name of the body part to create and add to the character.
@param string [UNKNOWN_PART] part_type The type of the body part.
@returns boolean If part was added successfully.
Attempts to add a body part with the given name to the character . Returns true if this was successful false if there was another body part with the same name attached . @param string part_name The name of the body part to create and add to the character . @param string [ UNKNOWN_PART ] part_type The type of the body part . @returns boolean If part was added successfully .
int Character_add_body_part(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			if (lua_isstr(lua, 2))
			{
				BodyPartType::PartType type = BodyPartType::UNKNOWN_PART;
				if (lua_isstr(lua, 3))
				{
					type = BodyPartType::getBodyPartType(lua_tostring(lua, 3));
				}
				lua_pushboolean(lua, obj->addBodyPart(new BodyPart(lua_tostring(lua, 2), type)));
				return 1;
			}
			BodyPart *part = castUData<BodyPart>(lua, 2);
			if (part)
			{
				lua_pushboolean(lua, obj->addBodyPart(part));
				return 1;
			}
			return LuaState::expectedArgs(lua, "add_body_part", 2, "am.body_part part", "string part_name, string [UNKNOWN_PART] part_type");
		}
		return LuaState::expectedContext(lua, "add_body_part", "am.character");
	}
int Character_add_body_part ( lua_State * lua ) { Character * obj = castUData < Character > ( lua , 1 ) ; if ( obj ) { if ( lua_isstr ( lua , 2 ) ) { BodyPartType :: PartType type = BodyPartType :: UNKNOWN_PART ; if ( lua_isstr ( lua , 3 ) ) { type = BodyPartType :: getBodyPartType ( lua_tostring ( lua , 3 ) ) ; } lua_pushboolean ( lua , obj -> addBodyPart ( new BodyPart ( lua_tostring ( lua , 2 ) , type ) ) ) ; return 1 ; } BodyPart * part = castUData < BodyPart > ( lua , 2 ) ; if ( part ) { lua_pushboolean ( lua , obj -> addBodyPart ( part ) ) ; return 1 ; } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Attempts to add a body part with the given name to the character.
Attempts to add a body part with the given name to the character .