diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-05-28 15:33:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-05-28 15:33:01 -0300 |
commit | ab37700e8b255e58e361d0cca7fb5b0996b6e376 (patch) | |
tree | 0697015291c20970e1621a6293ca329edecea40f | |
parent | b3947f1be5c65bc7e71ff4e1f7ce9178e26328e3 (diff) | |
download | serverdata-ab37700e8b255e58e361d0cca7fb5b0996b6e376.tar.gz serverdata-ab37700e8b255e58e361d0cca7fb5b0996b6e376.tar.bz2 serverdata-ab37700e8b255e58e361d0cca7fb5b0996b6e376.tar.xz serverdata-ab37700e8b255e58e361d0cca7fb5b0996b6e376.zip |
MapToLoc failure: Be verbose when needed
-rw-r--r-- | npc/functions/util.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 5ac5beda7..164c7d7d8 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -924,12 +924,18 @@ function script MapToLoc { // Fill variable .@v$=getarg(0); + // Error code + if (playerattached()) + .@err=RB_DEFAULT; + 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$); if (.@lx < 0) - return Exception("Invalid map passed to MapToLoc: "+.@v$, RB_DEBUGMES); + return Exception("Invalid map passed to MapToLoc: "+.@v$, .@err); return .@locs$[.@lx]; } |