summaryrefslogtreecommitdiffstats
path: root/source/Entities/Pickup.cpp
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2013-10-28 23:40:13 +0100
committerSamuel Barney <samjbarney@gmail.com>2013-10-28 23:40:13 +0100
commitd7a490a99205d69abce52c77854fafee52b4e82b (patch)
tree92e68ff622fc89bd94e11c7ed7fc548ed3129047 /source/Entities/Pickup.cpp
parentGot spiders and other mobs respecting night and day for spawning (diff)
parentProtoProxy: Implemented 1.7.2 status request / response / ping. (diff)
downloadcuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.gz
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.bz2
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.lz
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.xz
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.zst
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.zip
Diffstat (limited to 'source/Entities/Pickup.cpp')
-rw-r--r--source/Entities/Pickup.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/Entities/Pickup.cpp b/source/Entities/Pickup.cpp
index 075f93449..bc8abd204 100644
--- a/source/Entities/Pickup.cpp
+++ b/source/Entities/Pickup.cpp
@@ -24,11 +24,12 @@
-cPickup::cPickup(double a_X, double a_Y, double a_Z, const cItem & a_Item, float a_SpeedX /* = 0.f */, float a_SpeedY /* = 0.f */, float a_SpeedZ /* = 0.f */)
- : cEntity(etPickup, a_X, a_Y, a_Z, 0.2, 0.2)
+cPickup::cPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, bool IsPlayerCreated, float a_SpeedX /* = 0.f */, float a_SpeedY /* = 0.f */, float a_SpeedZ /* = 0.f */)
+ : cEntity(etPickup, a_PosX, a_PosY, a_PosZ, 0.2, 0.2)
, m_Timer( 0.f )
, m_Item(a_Item)
, m_bCollected( false )
+ , m_bIsPlayerCreated( IsPlayerCreated )
{
m_MaxHealth = 5;
m_Health = 5;
@@ -126,8 +127,8 @@ bool cPickup::CollectedBy(cPlayer * a_Dest)
return false; // It's already collected!
}
- // 800 is to long
- if (m_Timer < 500.f)
+ // Two seconds if player created the pickup (vomiting), half a second if anything else
+ if (m_Timer < (m_bIsPlayerCreated ? 2000.f : 500.f))
{
// LOG("Pickup %d cannot be collected by \"%s\", because it is not old enough.", m_UniqueID, a_Dest->GetName().c_str());
return false; // Not old enough