mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/block/power.rs')
-rw-r--r--src/block/power.rs21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/block/power.rs b/src/block/power.rs
index 7b04135..d891a8f 100644
--- a/src/block/power.rs
+++ b/src/block/power.rs
@@ -12,15 +12,12 @@ make_simple!(
Neoplasia,
|_, _, _, _, rot: Rotation, scl| {
let mut base = load!("neoplasia-reactor", scl);
- unsafe {
- base.overlay(
- load!(scl -> match rot {
- Rotation::Up | Rotation::Right => "neoplasia-reactor-top1",
- Rotation::Down | Rotation::Left => "neoplasia-reactor-top2",
- })
- .rotate(rot.rotated(false).count()),
- )
- };
+ let mut top = load!(scl -> match rot {
+ Rotation::Up | Rotation::Right => "neoplasia-reactor-top1",
+ Rotation::Down | Rotation::Left => "neoplasia-reactor-top2",
+ });
+ unsafe { top.rotate(rot.rotated(false).count()) };
+ unsafe { base.overlay(&top) };
base
},
|_, buff: &mut DataRead| read_heater(buff)
@@ -31,10 +28,8 @@ make_simple!(DiodeBlock, |_, _, _, _, rot: Rotation, s| {
return base;
}
let mut top = load!("diode-arrow", s);
- unsafe {
- top.rotate(rot.rotated(false).count());
- base.overlay(&top)
- };
+ unsafe { top.rotate(rot.rotated(false).count()) };
+ unsafe { base.overlay(&top) };
base
});