lua/wrappers/game/lua_character.cpp
/**
	 * Adds an item to the characters inventory.
	 * Returns true if it was successful, false there was not enough space.
	 *
	 * @param am.item item The item to add.
	 * @returns boolean True for successful add.
	 */
Adds an item to the characters inventory.
Returns true if it was successful, false there was not enough space.


Adds an item to the characters inventory . Returns true if it was successful false there was not enough space .
int Character_add_item(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			Item *item = castUData<Item>(lua, 2);
			if (item)
			{
				lua_pushboolean(lua, obj->addItem(item));
				return 1;
			}
			return LuaState::expectedArgs(lua, "add_item", "am.item item");
		}
		return LuaState::expectedContext(lua, "add_item", "am.character");
	}
int Character_add_item ( lua_State * lua ) { Character * obj = castUData < Character > ( lua , 1 ) ; if ( obj ) { Item * item = castUData < Item > ( lua , 2 ) ; if ( item ) { lua_pushboolean ( lua , obj -> addItem ( item ) ) ; return 1 ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Adds an item to the characters inventory.
Adds an item to the characters inventory .