summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-01-03 12:08:00 -0500
committergumi <mekolat@users.noreply.github.com>2017-01-04 11:28:37 -0500
commitab6b97f77856f638a8efa210c1b6869c909c988f (patch)
tree17903a4c217b9765fc94e06faaccca8a3f99a466
parent10453a6425c2d6796dc53d688cd19df1d8cb6a25 (diff)
downloadserverdata-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`
-rw-r--r--npc/commands/warp.txt10
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