From dad0037f987df594d6a1971af5b29f89c2d27901 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 22 Jun 2014 20:44:55 +0100 Subject: Bettered zombie and skeleton AI * Fixed potential issues with skylight detection --- src/Mobs/Zombie.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Mobs/Zombie.cpp') diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp index f19e096ee..725790ed9 100644 --- a/src/Mobs/Zombie.cpp +++ b/src/Mobs/Zombie.cpp @@ -44,11 +44,10 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer) void cZombie::MoveToPosition(const Vector3f & a_Position) { - // If the destination is in the sun and if it is not night AND the zombie isn't on fire then block the movement. + // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement if ( !IsOnFire() && - (m_World->GetTimeOfDay() < 13187) && - (m_World->GetBlockSkyLight((int)a_Position.x, (int)a_Position.y, (int)a_Position.z) == 15) + (m_World->GetBlockSkyLight((int)floor(a_Position.x), (int)floor(a_Position.y), (int)floor(a_Position.z)) - m_World->GetSkyDarkness() > 8) ) { m_bMovingToDestination = false; -- cgit v1.2.3 From f1be1eb6743700515de3a522898ba99680cf24c0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 18 Jul 2014 10:47:00 +0100 Subject: Monster fixes * Fixes #1203 * Fixes #627 --- src/Mobs/Zombie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Zombie.cpp') diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp index 725790ed9..30225c32d 100644 --- a/src/Mobs/Zombie.cpp +++ b/src/Mobs/Zombie.cpp @@ -42,7 +42,7 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer) -void cZombie::MoveToPosition(const Vector3f & a_Position) +void cZombie::MoveToPosition(const Vector3d & a_Position) { // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement if ( -- cgit v1.2.3