From 07cfe8ee35a7511c51bfd4ac98423a76eef411cb Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 13 May 2013 20:29:52 +0000 Subject: Added more logging to pickup collection code. Hoping to fix irresponsive pickups, http://forum.mc-server.org/showthread.php?tid=434&pid=8019#pid8019 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1481 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Pickup.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/Pickup.cpp b/source/Pickup.cpp index 7c1295121..c6f80495d 100644 --- a/source/Pickup.cpp +++ b/source/Pickup.cpp @@ -128,19 +128,24 @@ void cPickup::Tick(float a_Dt, cChunk & a_Chunk) bool cPickup::CollectedBy(cPlayer * a_Dest) { + ASSERT(a_Dest != NULL); + if (m_bCollected) { + LOG("Pickup %d cannot be collected by \"%s\", because it has already been collected.", a_Dest->GetName().c_str(), m_UniqueID); return false; // It's already collected! } // 800 is to long if (m_Timer < 500.f) { + LOG("Pickup %d cannot be collected by \"%s\", because it is not old enough.", a_Dest->GetName().c_str(), m_UniqueID); return false; // Not old enough } if (cRoot::Get()->GetPluginManager()->CallHookCollectingPickup(a_Dest, *this)) { + LOG("Pickup %d cannot be collected by \"%s\", because a plugin has said no.", a_Dest->GetName().c_str(), m_UniqueID); return false; } @@ -158,6 +163,7 @@ bool cPickup::CollectedBy(cPlayer * a_Dest) return true; } + LOG("Pickup %d cannot be collected by \"%s\", because there's no space in the inventory.", a_Dest->GetName().c_str(), m_UniqueID); return false; } -- cgit v1.2.3