From 322ba59c3a0500226e1b934c3390cffe4360ddb4 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 29 May 2012 19:56:07 +0000 Subject: Refactored item-eating from cClientHandle into cPlayer git-svn-id: http://mc-server.googlecode.com/svn/trunk@519 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/cPlayer.h') diff --git a/source/cPlayer.h b/source/cPlayer.h index 830289046..815c31316 100644 --- a/source/cPlayer.h +++ b/source/cPlayer.h @@ -81,7 +81,10 @@ public: void TossItem( bool a_bDraggingItem, int a_Amount = 1 ); //tolua_export void Heal( int a_Health ); //tolua_export - void Feed( short a_Food ); + + /// Returns true if any food has been consumed, false if player "full" + bool Feed(short a_Food); + void TakeDamage( int a_Damage, cEntity* a_Instigator ); //tolua_export void KilledBy( cEntity* a_Killer ); //tolua_export void Respawn(); //tolua_export @@ -97,8 +100,10 @@ public: const AString & GetLoadedWorldName() { return m_LoadedWorldName; } - void UseEquippedItem(); + void UseEquippedItem(void); + /// Returns true if the item type is edible && it has been consumed, false otherwise + bool EatItem(int a_ItemType); protected: virtual void Destroyed(); -- cgit v1.2.3