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:
parent
fd26595b56
commit
07cfe8ee35
@ -128,19 +128,24 @@ void cPickup::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
|
|
||||||
bool cPickup::CollectedBy(cPlayer * a_Dest)
|
bool cPickup::CollectedBy(cPlayer * a_Dest)
|
||||||
{
|
{
|
||||||
|
ASSERT(a_Dest != NULL);
|
||||||
|
|
||||||
if (m_bCollected)
|
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!
|
return false; // It's already collected!
|
||||||
}
|
}
|
||||||
|
|
||||||
// 800 is to long
|
// 800 is to long
|
||||||
if (m_Timer < 500.f)
|
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
|
return false; // Not old enough
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cRoot::Get()->GetPluginManager()->CallHookCollectingPickup(a_Dest, *this))
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,6 +163,7 @@ bool cPickup::CollectedBy(cPlayer * a_Dest)
|
|||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user