summaryrefslogtreecommitdiff
path: root/npc/functions/default_npc_checks.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-09 23:32:29 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-09 23:32:29 -0300
commit7ef0e07e7c895297e93446abfb2a5e55d3457450 (patch)
tree1543beda90f646f7cb2c4afbc533dd5690c69bac /npc/functions/default_npc_checks.txt
parentded359138a187681cab38c90b801e2f16d42e5a8 (diff)
downloadserverdata-7ef0e07e7c895297e93446abfb2a5e55d3457450.tar.gz
serverdata-7ef0e07e7c895297e93446abfb2a5e55d3457450.tar.bz2
serverdata-7ef0e07e7c895297e93446abfb2a5e55d3457450.tar.xz
serverdata-7ef0e07e7c895297e93446abfb2a5e55d3457450.zip
This should fix NPC distance hack
Diffstat (limited to 'npc/functions/default_npc_checks.txt')
-rwxr-xr-xnpc/functions/default_npc_checks.txt6
1 files 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;
}