mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
break when there are no stations
This commit is contained in:
@ -122,15 +122,16 @@ impl Structure for Workshop {
|
|||||||
SpriteKind::Anvil,
|
SpriteKind::Anvil,
|
||||||
SpriteKind::DismantlingBench,
|
SpriteKind::DismantlingBench,
|
||||||
];
|
];
|
||||||
for d in 0..3 {
|
'outer: for d in 0..3 {
|
||||||
for dir in CARDINALS {
|
for dir in CARDINALS {
|
||||||
let position = center + dir * (3 + d * 2);
|
if stations.is_empty() {
|
||||||
if !stations.is_empty() {
|
break 'outer;
|
||||||
let cr_station = stations.swap_remove(
|
|
||||||
RandomField::new(0).get(position.with_z(base)) as usize % stations.len(),
|
|
||||||
);
|
|
||||||
painter.sprite(position.with_z(base), cr_station);
|
|
||||||
}
|
}
|
||||||
|
let position = center + dir * (3 + d * 2);
|
||||||
|
let cr_station = stations.swap_remove(
|
||||||
|
RandomField::new(0).get(position.with_z(base)) as usize % stations.len(),
|
||||||
|
);
|
||||||
|
painter.sprite(position.with_z(base), cr_station);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user