summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-05-08 17:30:29 -0400
committergumi <git@gumi.ca>2018-05-08 17:30:29 -0400
commit24f72660c2a527f59273257a1ceee5c6851f6981 (patch)
tree4c4ce9703c3ac6b9286d4d4a8a8e92f3d2a0e8ab
parentf41889c55a3d23c83db0a8cb45a14ddb9c801a84 (diff)
downloadserverdata-24f72660c2a527f59273257a1ceee5c6851f6981.tar.gz
serverdata-24f72660c2a527f59273257a1ceee5c6851f6981.tar.bz2
serverdata-24f72660c2a527f59273257a1ceee5c6851f6981.tar.xz
serverdata-24f72660c2a527f59273257a1ceee5c6851f6981.zip
don't abort when a free tile can't be found for @warp
-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 f042f58a..318489d7 100644
--- a/npc/commands/warp.txt
+++ b/npc/commands/warp.txt
@@ -59,9 +59,13 @@ OnCall:
while (!checkcell(.@map$, .@x, .@y, cell_chkpass))
{
- if (.@e == 50) end;
- .@x = rand(20, 250);
- .@y = rand(20, 250);
+ // FIXME: this whole cell finding loop is DIRTY!
+ // we should have a command to get a random free coordinate
+ // or we should make buildin_warp silently ignore 0,0
+
+ if (.@e == 50) break; // FIXME: triggers a console warning
+ .@x = rand(20, 20 + (.@e * 5));
+ .@y = rand(20, 20 + (.@e * 5));
++.@e;
}