From 24f72660c2a527f59273257a1ceee5c6851f6981 Mon Sep 17 00:00:00 2001 From: gumi Date: Tue, 8 May 2018 17:30:29 -0400 Subject: don't abort when a free tile can't be found for @warp --- npc/commands/warp.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'npc') 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; } -- cgit v1.2.3-70-g09d2