1
0

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
This commit is contained in:
madmaxoft@gmail.com 2013-05-13 20:29:52 +00:00
parent fd26595b56
commit 07cfe8ee35

View File

@ -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;
}