diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-01-03 11:54:00 -0500 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-01-03 11:54:00 -0500 |
commit | 10453a6425c2d6796dc53d688cd19df1d8cb6a25 (patch) | |
tree | c117cfa66df04dd3a149b4f7f0847cb0cf963786 /npc/commands | |
parent | bde4653b8015dcade0542010fe6251c3b0b6d8df (diff) | |
download | serverdata-10453a6425c2d6796dc53d688cd19df1d8cb6a25.tar.gz serverdata-10453a6425c2d6796dc53d688cd19df1d8cb6a25.tar.bz2 serverdata-10453a6425c2d6796dc53d688cd19df1d8cb6a25.tar.xz serverdata-10453a6425c2d6796dc53d688cd19df1d8cb6a25.zip |
don't allow warping to nonexistent map with `@w`
Diffstat (limited to 'npc/commands')
-rw-r--r-- | npc/commands/warp.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt index 8d14a628..55107c93 100644 --- a/npc/commands/warp.txt +++ b/npc/commands/warp.txt @@ -42,6 +42,17 @@ OnCall: .@y = atoi(.@atcmd_parameters$[2]); } + if (getmapusers(.@map$) < 0) + { + end; // invalid map + } + + else if (!checkcell(.@map$, .@x, .@y, cell_chkpass)) + { + // XXX: maybe send to random location? + end; // invalid coordinates + } + cwarp .@map$, .@x, .@y; // XXX: maybe here use a slide_or_warp function OnInit: |