From 7ef0e07e7c895297e93446abfb2a5e55d3457450 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 9 Apr 2021 23:32:29 -0300 Subject: This should fix NPC distance hack --- npc/functions/default_npc_checks.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npc/functions/default_npc_checks.txt b/npc/functions/default_npc_checks.txt index 0cc6e643..c02cf016 100755 --- a/npc/functions/default_npc_checks.txt +++ b/npc/functions/default_npc_checks.txt @@ -3,8 +3,9 @@ function script PCtoNPCRange { @npc_check = 0; if(!@npc_distance) set @npc_distance, 4; // <== default distance if(@npc_distance < 0) set @npc_distance, ATTACKRANGE; - cleararray @npc_loc, 0, 3; - if (!isin(getmap(), .x, .y, @npc_distance)) + .@x=getvariableofnpc(.x, getnpcid()); + .@y=getvariableofnpc(.y, getnpcid()); + if (!isin(getmap(), .@x, .@y, @npc_distance)) goto L_Return; @npc_check = 1; if(@distance_handler) goto L_Return; @@ -21,7 +22,6 @@ L_Return: @dnpc_name$ = ""; @distance_handler = 0; @npc_distance = 0; - cleararray @npc_loc, 0, 3; return; } -- cgit v1.2.3-60-g2f50