summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
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];
}