diff options
author | gumi <git@gumi.ca> | 2018-03-26 15:41:21 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-03-28 10:15:36 -0400 |
commit | 23a3adb0a735c2f71b25f3cfb4eddeee8214e278 (patch) | |
tree | daeb5bd67524757bc8fdb063a5fbab421105fca6 | |
parent | 7233ced3d5edaf1799e7bf5fa2961111128b9e5d (diff) | |
download | serverdata-23a3adb0a735c2f71b25f3cfb4eddeee8214e278.tar.gz serverdata-23a3adb0a735c2f71b25f3cfb4eddeee8214e278.tar.bz2 serverdata-23a3adb0a735c2f71b25f3cfb4eddeee8214e278.tar.xz serverdata-23a3adb0a735c2f71b25f3cfb4eddeee8214e278.zip |
make @w fully compatible with @warp
-rw-r--r-- | npc/commands/warp.txt | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt index 03c32803..508827fa 100644 --- a/npc/commands/warp.txt +++ b/npc/commands/warp.txt @@ -30,7 +30,7 @@ OnCall: .@ht = getvariableofnpc(.ht, "__anchors__"); .@it = htiterator(.@ht); - for (.@key$ = htinextkey(.@it); hticheck(.@it); .@key$ = htinextkey(.@it)) + for (.@key$ = htifirstkey(.@it); hticheck(.@it); .@key$ = htinextkey(.@it)) { if (.@request$ ~= .@key$) { @@ -47,7 +47,17 @@ OnCall: // FIXME: here getmapusers() is used only to check if the map exists // replace this when/if we get a dedicated function for that if (getmapusers(.@map$) < 0) - end; // invalid map + { + if (getmapusers(.@atcmd_parameters$[0]) >= 0) + { + .@map$ = .@atcmd_parameters$[0]; + } + else + { + dispbottom(l("Map or anchor not found: %s", .@atcmd_parameters$[0])); + end; + } + } while (!checkcell(.@map$, .@x, .@y, cell_chkpass)) { @@ -62,7 +72,17 @@ OnCall: OnInit: if (debug > 0) + { bindatcmd("w", "@w::OnCall", 0, 2, 0); + bindatcmd("go", "@w::OnCall", 0, 2, 0); + bindatcmd("to", "@w::OnCall", 0, 2, 0); + bindatcmd("warp", "@w::OnCall", 0, 2, 0); + } else - bindatcmd("w", "@w::OnCall", 1, 2, 1); + { + bindatcmd("w", "@w::OnCall", 2, 2, 1); + bindatcmd("go", "@w::OnCall", 2, 2, 1); + bindatcmd("to", "@w::OnCall", 2, 2, 1); + bindatcmd("warp", "@w::OnCall", 2, 2, 1); + } } |