summaryrefslogtreecommitdiff
path: root/npc/functions/default_npc_checks.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/default_npc_checks.txt')
-rwxr-xr-xnpc/functions/default_npc_checks.txt10
1 files changed, 2 insertions, 8 deletions
diff --git a/npc/functions/default_npc_checks.txt b/npc/functions/default_npc_checks.txt
index b08bb9c3..0cc6e643 100755
--- a/npc/functions/default_npc_checks.txt
+++ b/npc/functions/default_npc_checks.txt
@@ -1,16 +1,10 @@
function script PCtoNPCRange {
@npc_check = 0;
- @Nmap$ = strnpcinfo(3);
if(!@npc_distance) set @npc_distance, 4; // <== default distance
- if(@npc_distance == (1-2)) set @npc_distance, ATTACKRANGE;
+ if(@npc_distance < 0) set @npc_distance, ATTACKRANGE;
cleararray @npc_loc, 0, 3;
- setarray @npc_loc, getnpcx(), getnpcy(), @npc_distance;
- @Nx1 = (@npc_loc[0] - @npc_loc[2]);
- @Ny1 = (@npc_loc[1] - @npc_loc[2]);
- @Nx2 = (@npc_loc[0] + @npc_loc[2]);
- @Ny2 = (@npc_loc[1] + @npc_loc[2]);
- if (isin(@Nmap$, @Nx1, @Ny1, @Nx2, @Ny2))
+ if (!isin(getmap(), .x, .y, @npc_distance))
goto L_Return;
@npc_check = 1;
if(@distance_handler) goto L_Return;