From c6b4ee8c9fb597b6f87f4cb756f43d5548ab2d66 Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Wed, 28 Dec 2011 21:00:35 +0000 Subject: - implemented the fire simulation in native c++ (cFireSimulator) - Changed the Durationsystem for Items. cPlayer::UseEquippedItem calls cItem::DamageItem this function damages the item if it has a duration. (needed the duration also in another place so this saves code ;)) - added some other burning blocks - the mobtypes for the settings.ini which i must have forgotten in the last commit git-svn-id: http://mc-server.googlecode.com/svn/trunk@150 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/cPlayer.cpp') 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 -- cgit v1.2.3