1
0

Added logging to pickup collection when a player is near and when collecting.

This should help fix the inactive pickups bug, http://forum.mc-server.org/showthread.php?tid=434&pid=8019#pid8019 )

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1480 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-05-13 20:26:45 +00:00
parent 0a08ae14f6
commit fd26595b56

View File

@ -1565,9 +1565,18 @@ void cChunk::CollectPickupsByPlayer(cPlayer * a_Player)
float SqrDist = DiffX * DiffX + DiffY * DiffY + DiffZ * DiffZ; float SqrDist = DiffX * DiffX + DiffY * DiffY + DiffZ * DiffZ;
if (SqrDist < 1.5f * 1.5f) // 1.5 block if (SqrDist < 1.5f * 1.5f) // 1.5 block
{ {
LOG("Pickup %d being collected by player \"%s\", distance %f",
(*itr)->GetUniqueID(), a_Player->GetName().c_str(), SqrDist
);
MarkDirty(); MarkDirty();
(reinterpret_cast<cPickup *>(*itr))->CollectedBy( a_Player ); (reinterpret_cast<cPickup *>(*itr))->CollectedBy( a_Player );
} }
else if (SqrDist < 5 * 5)
{
LOG("Pickup %d close to player \"%s\", but still too far to collect: %f",
(*itr)->GetUniqueID(), a_Player->GetName().c_str(), SqrDist
);
}
} }
} }