From dd638516063bb089209d13e1abdf3429ddc5a8fe Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sat, 12 Oct 2024 19:00:02 +0200 Subject: [PATCH] fix tiles being unable to get powered from multiple directions at once --- README.md | 2 +- src/marble_engine.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d8adac7..0931c92 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ logic mostly like https://git.crispypin.cc/CrispyPin/marble ## todo (more levels) story/lore +copy/cut/paste selections timestamps in solutions and blueprints multiple input/output sets undo/redo make math tiles read digits -fix bag tiles only counting power in one direction at once tooltips lock tile types for early levels to make it less overwhelming make a gui alternative to pressing R to rotate between tile variants diff --git a/src/marble_engine.rs b/src/marble_engine.rs index 3b60659..b1a80cd 100644 --- a/src/marble_engine.rs +++ b/src/marble_engine.rs @@ -302,12 +302,13 @@ impl Machine { if let PTile::Trigger = tile { return; } - if *state { - return; - } + let was_powered = *state; *state = true; match tile { PTile::Wire(wiretype) => { + if was_powered { + return; + } let dirs = wiretype.directions(); for d in dirs { self.propagate_power(*d, d.step(pos));