From 3dc3e5eca7358a09c7be412b6b735cd38a3eced3 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 2 Nov 2013 20:45:51 +0100 Subject: Zombies and Skeletons don't walk into the sun anymore. --- source/Mobs/Zombie.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/Mobs/Zombie.cpp') diff --git a/source/Mobs/Zombie.cpp b/source/Mobs/Zombie.cpp index 1752ec390..a485d2b55 100644 --- a/source/Mobs/Zombie.cpp +++ b/source/Mobs/Zombie.cpp @@ -30,3 +30,18 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer) + +void cZombie::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; +} + + -- cgit v1.2.3