mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
changed on advice from target
This commit is contained in:
parent
424a8c17b3
commit
5078ed9d0f
@ -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);
|
||||
|
||||
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;
|
||||
|
||||
TraceResult tr;
|
||||
Vector vecLookerOrigin;
|
||||
cell *addr = MF_GetAmxAddr(amx, params[2]);
|
||||
|
||||
Vector vecOrigin(amx_ctof(addr[0]), amx_ctof(addr[1]), amx_ctof(addr[2]));
|
||||
|
||||
vecLookerOrigin = pEntity->v.origin + pEntity->v.view_ofs;
|
||||
|
||||
TRACE_LINE(vecLookerOrigin, vecOrigin, ignore_monsters, pEntity, &tr);
|
||||
TRACE_LINE(vLooker, vTarget, FALSE, pEntity, &tr);
|
||||
|
||||
if (tr.flFraction != 1.0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user