summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-04 13:41:23 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-04 13:41:23 -0300
commit22524d2f042d3645a7cd0b0aaa6bee13fea61cd8 (patch)
tree123c07ecc41613b7c75fada4124351a69ecd7905 /npc/functions/util.txt
parent2050c457b7aaf14e0dc6e6b2b4793da1be6f828b (diff)
downloadserverdata-22524d2f042d3645a7cd0b0aaa6bee13fea61cd8.tar.gz
serverdata-22524d2f042d3645a7cd0b0aaa6bee13fea61cd8.tar.bz2
serverdata-22524d2f042d3645a7cd0b0aaa6bee13fea61cd8.tar.xz
serverdata-22524d2f042d3645a7cd0b0aaa6bee13fea61cd8.zip
Avoid redeclaration of towns and locations at MapToLoc and LocToMap (also fix bugs)
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt21
1 files changed, 8 insertions, 13 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index fb93ff074..c3c1f390a 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -927,9 +927,8 @@ function script EnterTown {
// Fill variable
.@v$=getarg(0);
- // Validade variable, see npc/000-1/exit.txt first
- setarray .@locs$, "Candor", "Tulim", "Halin", "Hurns", "LoF", "Lilit", "Nival", "Frostia";
- if (array_find(.@locs$, .@v$) < 0)
+ // Validade variable, see npc/config/location.txt first
+ if (array_find($@LOCMASTER_LOC$, .@v$) < 0)
return Exception("Invalid location passed to EnterTown: "+.@v$);
LOCATION$=.@v$;
@@ -948,14 +947,12 @@ function script LocToMap {
else
.@err=RB_DEBUGMES;
- // Validade variable, see npc/000-1/exit.txt first
- setarray .@mapx$, "005-1", "003-1", "009-1", "012-1", "017-1", "018-5", "020-1", "024-1";
- setarray .@locs$, "Candor", "Tulim", "Halin", "Hurns", "LoF", "Lilit", "Nival", "Frostia";
- .@lx=array_find(.@locs$, .@v$);
+ // Validade variable, see npc/config/location.txt first
+ .@lx=array_find($@LOCMASTER_LOC$, .@v$);
if (.@lx < 0)
return Exception("Invalid location passed to LocToMap: "+.@v$, .@err);
- return .@locs$[.@lx];
+ return $@LOCMASTER_MAP$[.@lx];
}
// Convert map name to location id
@@ -970,14 +967,12 @@ function script MapToLoc {
else
.@err=RB_DEBUGMES;
- // Validade variable, see npc/000-1/exit.txt first
- setarray .@mapx$, "005-1", "003-1", "009-1", "012-1", "017-1", "018-5", "020-1", "024-1";
- setarray .@locs$, "Candor", "Tulim", "Halin", "Hurns", "LoF", "Lilit", "Nival", "Frostia";
- .@lx=array_find(.@mapx$, .@v$);
+ // Validade variable, see npc/config/location.txt first
+ .@lx=array_find($@LOCMASTER_MAP$, .@v$);
if (.@lx < 0)
return Exception("Invalid map passed to MapToLoc: "+.@v$, .@err);
- return .@locs$[.@lx];
+ return $@LOCMASTER_LOC$[.@lx];
}
// Returns TOP 3 Average Level