break when there are no stations

This commit is contained in:
IsseW 2022-02-20 22:11:09 +01:00
parent 258b3c7535
commit e9e4be6e7e

View File

@ -122,10 +122,12 @@ impl Structure for Workshop {
SpriteKind::Anvil,
SpriteKind::DismantlingBench,
];
for d in 0..3 {
'outer: for d in 0..3 {
for dir in CARDINALS {
if stations.is_empty() {
break 'outer;
}
let position = center + dir * (3 + d * 2);
if !stations.is_empty() {
let cr_station = stations.swap_remove(
RandomField::new(0).get(position.with_z(base)) as usize % stations.len(),
);
@ -133,5 +135,4 @@ impl Structure for Workshop {
}
}
}
}
}