diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-01-03 12:08:00 -0500 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-01-04 11:28:37 -0500 |
commit | ab6b97f77856f638a8efa210c1b6869c909c988f (patch) | |
tree | 17903a4c217b9765fc94e06faaccca8a3f99a466 /npc | |
parent | 10453a6425c2d6796dc53d688cd19df1d8cb6a25 (diff) | |
download | serverdata-ab6b97f77856f638a8efa210c1b6869c909c988f.tar.gz serverdata-ab6b97f77856f638a8efa210c1b6869c909c988f.tar.bz2 serverdata-ab6b97f77856f638a8efa210c1b6869c909c988f.tar.xz serverdata-ab6b97f77856f638a8efa210c1b6869c909c988f.zip |
send to a random x,y when not walkable in `@w`
Diffstat (limited to 'npc')
-rw-r--r-- | npc/commands/warp.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt index 55107c93..5bfb8c01 100644 --- a/npc/commands/warp.txt +++ b/npc/commands/warp.txt @@ -42,15 +42,19 @@ OnCall: .@y = atoi(.@atcmd_parameters$[2]); } + // 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 } - else if (!checkcell(.@map$, .@x, .@y, cell_chkpass)) + while (!checkcell(.@map$, .@x, .@y, cell_chkpass)) { - // XXX: maybe send to random location? - end; // invalid coordinates + if (.@e == 50) end; + .@x = rand(20, 250); + .@y = rand(20, 250); + ++.@e; } cwarp .@map$, .@x, .@y; // XXX: maybe here use a slide_or_warp function |