1
0

Monsters no longer check for direct line of sight

This commit is contained in:
Tiger Wang 2014-01-24 20:46:22 +00:00
parent 9c0e3615ce
commit 1f82b6e192

View File

@ -11,7 +11,6 @@
#include "../MonsterConfig.h" #include "../MonsterConfig.h"
#include "../MersenneTwister.h" #include "../MersenneTwister.h"
#include "../Tracer.h"
#include "../Chunk.h" #include "../Chunk.h"
#include "../FastRandom.h" #include "../FastRandom.h"
@ -507,16 +506,9 @@ void cMonster::CheckEventSeePlayer(void)
void cMonster::CheckEventLostPlayer(void) void cMonster::CheckEventLostPlayer(void)
{ {
Vector3f pos;
cTracer LineOfSight(GetWorld());
if (m_Target != NULL) if (m_Target != NULL)
{ {
pos = m_Target->GetPosition(); if ((m_Target->GetPosition() - GetPosition()).Length() > m_SightDistance)
if (
((pos - GetPosition()).Length() > m_SightDistance) ||
LineOfSight.Trace(Vector3d(GetPosX(), GetPosY() + 1, GetPosZ()), (pos - GetPosition()), (int)(pos - GetPosition()).Length())
)
{ {
EventLosePlayer(); EventLosePlayer();
} }