Only choose spawn locations that are on-board (not border) locations.

Otherwise the spawning will fail.
This commit is contained in:
J. Tyne 2013-02-01 04:48:38 +00:00
parent 82b26cf7fe
commit 3a65fbd2c8

View file

@ -32,13 +32,21 @@ Note: You need to use the default map settings for the scenario to work right."
{RANDOMIZE $location}
[store_locations]
variable=locs
x=$spawn_place[$random].x
y=$spawn_place[$random].y
radius=1
[and]
x=$spawn_place[$random].x
y=$spawn_place[$random].y
radius=1
[/and]
# Avoid border hexes; we cannot spawn there.
[and]
x=1-16
y=8-22
[/and]
[/store_locations]
{RANDOMIZE_INDEX $locs.length}
{VARIABLE spawn_x $locs[$random].x}
{VARIABLE spawn_y $locs[$random].y}
{CLEAR_VARIABLE locs}
[/then]
[/if]
[store_unit]