summaryrefslogtreecommitdiff
path: root/npc/functions/default_npc_checks.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/default_npc_checks.txt')
-rw-r--r--npc/functions/default_npc_checks.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/npc/functions/default_npc_checks.txt b/npc/functions/default_npc_checks.txt
index ee12bc49..c8dbec47 100644
--- a/npc/functions/default_npc_checks.txt
+++ b/npc/functions/default_npc_checks.txt
@@ -1,14 +1,13 @@
function script PCtoNPCRange {
@npc_check = 0;
- if(!@npc_distance) set @npc_distance, 4; // <== default distance
- if(@npc_distance < 0) set @npc_distance, ATTACKRANGE;
+ if(!@npc_distance) set @npc_distance, getarg(0, 4); // <== default distance
+ if(@npc_distance < 0) set @npc_distance, readparam2(UDT_ATKRANGE);
.@x=getvariableofnpc(.x, strnpcinfo(0));
.@y=getvariableofnpc(.y, strnpcinfo(0));
if (isin(getmap(), .@x, .@y, @npc_distance))
goto L_Return;
@npc_check = 1;
- if(@distance_handler) goto L_Return;
@dnpc_name$ = strnpcinfo(1);
if(@dnpc_name$ != "") goto L_Named;
message strcharinfo(0), "Server : ##BYou need to move closer to interact with this npc.";
@@ -20,8 +19,11 @@ L_Named:
L_Return:
@dnpc_name$ = "";
- @distance_handler = 0;
@npc_distance = 0;
+ if (@npc_check) {
+ @npc_check = 0;
+ end;
+ }
return;
}