From 5078ed9d0f0e1d6b995c236b184930263c3bc4ad Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 1 Aug 2005 19:01:25 +0000 Subject: [PATCH] changed on advice from target --- dlls/engine/engine.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/engine/engine.cpp b/dlls/engine/engine.cpp index ce60c4d2..2760cae4 100755 --- a/dlls/engine/engine.cpp +++ b/dlls/engine/engine.cpp @@ -830,19 +830,19 @@ static cell AMX_NATIVE_CALL set_usercmd(AMX *amx, cell *params) static cell AMX_NATIVE_CALL is_visible(AMX *amx, cell *params) { int src = params[1]; + int dest = params[2]; CHECK_ENTITY(src); + CHECK_ENTITY(dest); - edict_t *pEntity = INDEXENT(src); + edict_t *pEntity = MF_GetPlayerEdict(src); + edict_t *pTarget = MF_GetPlayerEdict(dest); - TraceResult tr; - Vector vecLookerOrigin; - cell *addr = MF_GetAmxAddr(amx, params[2]); + Vector vLooker = ((pEntity->v.absmin + pEntity->v.absmax) * pEntity->v.fov) + pEntity->v.view_ofs; + Vector vTarget = (pTarget->v.absmin + pTarget->v.absmax) * pTarget->v.fov; - Vector vecOrigin(amx_ctof(addr[0]), amx_ctof(addr[1]), amx_ctof(addr[2])); - - vecLookerOrigin = pEntity->v.origin + pEntity->v.view_ofs; + TraceResult tr; - TRACE_LINE(vecLookerOrigin, vecOrigin, ignore_monsters, pEntity, &tr); + TRACE_LINE(vLooker, vTarget, FALSE, pEntity, &tr); if (tr.flFraction != 1.0) {