summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-24 21:46:22 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-24 21:46:22 +0100
commit1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d (patch)
tree36992d9f2935c493510afadd162674c80bfdd6bd /src/Mobs
parentLarge reworking of mob code [SEE DESC] (diff)
downloadcuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.tar
cuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.tar.gz
cuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.tar.bz2
cuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.tar.lz
cuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.tar.xz
cuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.tar.zst
cuberite-1f82b6e1920d0f56cad0f7a04c81cb0cf9823a1d.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/Monster.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 91ecf3b52..bd7894bf9 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -11,7 +11,6 @@
#include "../MonsterConfig.h"
#include "../MersenneTwister.h"
-#include "../Tracer.h"
#include "../Chunk.h"
#include "../FastRandom.h"
@@ -506,17 +505,10 @@ void cMonster::CheckEventSeePlayer(void)
void cMonster::CheckEventLostPlayer(void)
-{
- Vector3f pos;
- cTracer LineOfSight(GetWorld());
-
+{
if (m_Target != NULL)
{
- pos = m_Target->GetPosition();
- if (
- ((pos - GetPosition()).Length() > m_SightDistance) ||
- LineOfSight.Trace(Vector3d(GetPosX(), GetPosY() + 1, GetPosZ()), (pos - GetPosition()), (int)(pos - GetPosition()).Length())
- )
+ if ((m_Target->GetPosition() - GetPosition()).Length() > m_SightDistance)
{
EventLosePlayer();
}