From 9bed39b7d08b52d6ec7f3ed642d0afa2d113175c Mon Sep 17 00:00:00 2001 From: Azaezel Date: Fri, 11 Jul 2014 07:47:31 -0500 Subject: [PATCH] logical inversion to stock functionality as requested. Now assumes if it has a target and does not hit anything Static by the time the ray terminates, then it must be the right target. --- Engine/source/T3D/aiPlayer.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Engine/source/T3D/aiPlayer.cpp b/Engine/source/T3D/aiPlayer.cpp index fd0c179a3..0c9b930fe 100644 --- a/Engine/source/T3D/aiPlayer.cpp +++ b/Engine/source/T3D/aiPlayer.cpp @@ -28,8 +28,7 @@ #include "T3D/gameBase/moveManager.h" #include "console/engineAPI.h" -static U32 sAIPlayerLoSMask = TerrainObjectType | WaterObjectType | - ShapeBaseObjectType | StaticShapeObjectType; +static U32 sAIPlayerLoSMask = TerrainObjectType | StaticShapeObjectType | StaticObjectType; IMPLEMENT_CO_NETOBJECT_V1(AIPlayer); @@ -643,19 +642,13 @@ bool AIPlayer::checkInLos(GameBase* target, bool _useMuzzle, bool _checkEnabled) eyeMat.getColumn(3, &checkPoint ); } - bool hit = gServerContainer.castRay(checkPoint , target->getBoxCenter(), sAIPlayerLoSMask, &ri); + bool hit = !gServerContainer.castRay(checkPoint, target->getBoxCenter(), sAIPlayerLoSMask, &ri); enableCollision(); for (S32 i = 0; i < mountCount; i++) { target->getMountedObject(i)->enableCollision(); } - - if (hit) - { - if (target != dynamic_cast(ri.object)) hit = false; - } - return hit; }