summaryrefslogtreecommitdiffstats
path: root/source/cPlayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/cPlayer.cpp')
-rw-r--r--source/cPlayer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp
index 7fbf1672b..92b16478a 100644
--- a/source/cPlayer.cpp
+++ b/source/cPlayer.cpp
@@ -830,4 +830,14 @@ const cPlayer::GroupList & cPlayer::GetGroups()
const char* cPlayer::GetLoadedWorldName()
{
return m_pState->LoadedWorldName.c_str();
+}
+
+void cPlayer::UseEquippedItem()
+{
+ if(GetGameMode() != 1) //No damage in creative
+ if (GetInventory().GetEquippedItem().DamageItem())
+ {
+ LOG("Player %s Broke ID: %i", GetClientHandle()->GetUsername(), GetInventory().GetEquippedItem().m_ItemID);
+ GetInventory().RemoveItem( GetInventory().GetEquippedItem());
+ }
} \ No newline at end of file