diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-28 22:00:35 +0100 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-28 22:00:35 +0100 |
commit | c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66 (patch) | |
tree | f223c11d65a1b0983651c7a2644149219b5f3617 /source/cPlayer.cpp | |
parent | - Fixed too fast actions kick for real (diff) | |
download | cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.tar cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.tar.gz cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.tar.bz2 cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.tar.lz cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.tar.xz cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.tar.zst cuberite-c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPlayer.cpp | 10 |
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 |