summaryrefslogtreecommitdiffstats
path: root/source/Entities/Pickup.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-10-24 08:36:25 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-10-24 08:36:25 +0200
commit54f5f71c9a3eb1d7d7516cc750e4bffba86bd585 (patch)
tree1ff9d4a148086e34f5b78751ec51d470928448ca /source/Entities/Pickup.cpp
parentAPIDump: Added cChatColor constants. (diff)
parentPickups now have collection delay when vomited (diff)
downloadcuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.tar
cuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.tar.gz
cuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.tar.bz2
cuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.tar.lz
cuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.tar.xz
cuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.tar.zst
cuberite-54f5f71c9a3eb1d7d7516cc750e4bffba86bd585.zip
Diffstat (limited to '')
-rw-r--r--source/Entities/Pickup.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/Entities/Pickup.cpp b/source/Entities/Pickup.cpp
index 075f93449..50431f52e 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 */)
+cPickup::cPickup(double a_X, double a_Y, double a_Z, const cItem & a_Item, bool IsPlayerCreated, 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)
, 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