summaryrefslogtreecommitdiffstats
path: root/source/Entities/ProjectileEntity.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-25 21:31:35 +0200
committermadmaxoft <github@xoft.cz>2013-08-25 21:31:35 +0200
commitda3e24863274a80f4bda0251e678ec354c8d59e6 (patch)
treebe1b541ba6ba5008700b3938364174fc9c5ab7de /source/Entities/ProjectileEntity.cpp
parentMoved entity spawning into cEntity::Initialize(). (diff)
downloadcuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.tar
cuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.tar.gz
cuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.tar.bz2
cuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.tar.lz
cuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.tar.xz
cuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.tar.zst
cuberite-da3e24863274a80f4bda0251e678ec354c8d59e6.zip
Diffstat (limited to '')
-rw-r--r--source/Entities/ProjectileEntity.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/Entities/ProjectileEntity.cpp b/source/Entities/ProjectileEntity.cpp
index e87f72eed..66d9409f5 100644
--- a/source/Entities/ProjectileEntity.cpp
+++ b/source/Entities/ProjectileEntity.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "ProjectileEntity.h"
#include "../ClientHandle.h"
+#include "Player.h"
@@ -98,6 +99,22 @@ cArrowEntity::cArrowEntity(cEntity * a_Creator, double a_X, double a_Y, double a
+bool cArrowEntity::CanPickup(const cPlayer & a_Player) const
+{
+ switch (m_PickupState)
+ {
+ case psNoPickup: return false;
+ case psInSurvivalOrCreative: return (a_Player.IsGameModeSurvival() || a_Player.IsGameModeCreative());
+ case psInCreative: return a_Player.IsGameModeCreative();
+ }
+ ASSERT(!"Unhandled pickup state");
+ return false;
+}
+
+
+
+
+
void cArrowEntity::SpawnOn(cClientHandle & a_Client)
{
a_Client.SendSpawnObject(*this, pkArrow, 0, 0, 0);