diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-06-02 21:16:22 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-06-02 21:16:22 -0300 |
commit | bcb8d5f05db2627ef8bd2faee1151a19962d5593 (patch) | |
tree | 5f523c8950b97f23e19b0c790c080e884cce0286 | |
parent | 16e3c98746a541d3c8710ac7d53ffb1ea94873cd (diff) | |
download | serverdata-bcb8d5f05db2627ef8bd2faee1151a19962d5593.tar.gz serverdata-bcb8d5f05db2627ef8bd2faee1151a19962d5593.tar.bz2 serverdata-bcb8d5f05db2627ef8bd2faee1151a19962d5593.tar.xz serverdata-bcb8d5f05db2627ef8bd2faee1151a19962d5593.zip |
Add a fallback to Warp Mage Warp Magic, but there's technically no error.
-rw-r--r-- | npc/001-13/main.txt | 1 | ||||
-rw-r--r-- | npc/functions/util.txt | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/npc/001-13/main.txt b/npc/001-13/main.txt index d1557d273..cf1356523 100644 --- a/npc/001-13/main.txt +++ b/npc/001-13/main.txt @@ -267,4 +267,5 @@ OnClose: 001-13-0 mapflag zone MMO 001-13-1 mapflag zone MMO 001-13-2 mapflag zone MMO +001-13-3 mapflag zone MMO diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 4e6494d34..2d834ea2d 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -1220,6 +1220,15 @@ function script TPToLoc { // Warps home and updates LOCATION$ function script teleporthome { warp "Save", 0, 0; + if (getmap() == "000-1") { + consolewarn("[WARN] Failed to teleporthome, map %s savepoint %s. Fallback to %s", getmap(), getsavepoint(0), LOCATION$); + // Fallback - attempt to spoof the original location as a last resort + .@lx=array_find($@LOCMASTER_LOC$, LOCATION$); + if (.@lx >= 0) { + warp $@LOCMASTER_MAP$[.@lx], $@LOCMASTER_X[.@lx], $@LOCMASTER_Y[.@lx]; + end; + } + } .@i=array_find($@LOCMASTER_MAP$, getmap()); if (.@i >= 0) EnterTown($@LOCMASTER_LOC$[.@i]); |