summaryrefslogtreecommitdiffstats
path: root/source/Mobs/Skeleton.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-11-02 20:45:51 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-11-02 20:45:51 +0100
commit3dc3e5eca7358a09c7be412b6b735cd38a3eced3 (patch)
treed61afed887a7924685608cdde22922320547d488 /source/Mobs/Skeleton.cpp
parentChanged GameMode() == 1 to IsGameModeCreative in AggressiveMonster.cpp and ClientHandle.cpp (diff)
downloadcuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.tar
cuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.tar.gz
cuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.tar.bz2
cuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.tar.lz
cuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.tar.xz
cuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.tar.zst
cuberite-3dc3e5eca7358a09c7be412b6b735cd38a3eced3.zip
Diffstat (limited to '')
-rw-r--r--source/Mobs/Skeleton.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/Mobs/Skeleton.cpp b/source/Mobs/Skeleton.cpp
index 37a724848..3ca3ebbf7 100644
--- a/source/Mobs/Skeleton.cpp
+++ b/source/Mobs/Skeleton.cpp
@@ -3,6 +3,8 @@
#include "Skeleton.h"
#include "../World.h"
+#include "../Entities/ProjectileEntity.h"
+#include "../Entities/Entity.h"
@@ -28,3 +30,16 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cSkeleton::MoveToPosition(const Vector3f & a_Position)
+{
+ m_Destination = a_Position;
+
+ // If the destination is in the sun and if it is not night AND the skeleton isn't on fire then block the movement.
+ if ((m_World->GetBlockSkyLight((int) a_Position.x, (int) a_Position.y, (int) a_Position.z) == 15) && (m_World->GetTimeOfDay() < 13187) && !IsOnFire())
+ {
+ m_bMovingToDestination = false;
+ return;
+ }
+ m_bMovingToDestination = true;
+} \ No newline at end of file