1
0

Zombies and Skeletons don't walk into the sun anymore.

This commit is contained in:
STRWarrior
2013-11-02 20:45:51 +01:00
parent 52d956ccf3
commit 3dc3e5eca7
4 changed files with 32 additions and 0 deletions

View File

@@ -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;
}