summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-09-23 19:23:06 -0300
committerJesusaves <cpntb1@ymail.com>2021-09-23 19:23:06 -0300
commit11c2c4dec0a4d694182cb4dd702700889ce15159 (patch)
tree48a18e9a242d24439f35353e7816ea148a155839 /npc/functions/util.txt
parent6afbb9507dea2dc891a0a750abb6fd06805d22c1 (diff)
downloadserverdata-11c2c4dec0a4d694182cb4dd702700889ce15159.tar.gz
serverdata-11c2c4dec0a4d694182cb4dd702700889ce15159.tar.bz2
serverdata-11c2c4dec0a4d694182cb4dd702700889ce15159.tar.xz
serverdata-11c2c4dec0a4d694182cb4dd702700889ce15159.zip
Town Defense Program, which raises siege experience to 3×
(Default is a 35~42% exp bonus)
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index a276cd541..a07d6665a 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -1077,7 +1077,7 @@ function script LocToMap {
}
// Convert map name to location id
-// MapToLoc( MapName )
+// MapToLoc( MapName, report=True )
function script MapToLoc {
// Fill variable
.@v$=getarg(0);
@@ -1088,10 +1088,14 @@ function script MapToLoc {
else
.@err=RB_DEBUGMES;
- // Validade variable, see npc/config/location.txt first
+ // Validate 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);
+ if (.@lx < 0) {
+ if (getarg(1, true))
+ return Exception("Invalid map passed to MapToLoc: "+.@v$, .@err);
+ else
+ return "";
+ }
return $@LOCMASTER_LOC$[.@lx];
}