From 8957483e7196d21db0fb6257fedbea01b59cf53b Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 29 Jul 2021 20:30:21 -0300 Subject: Fix minor issues --- npc/functions/default_npc_checks.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'npc/functions/default_npc_checks.txt') 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; } -- cgit v1.2.3-60-g2f50