diff options
author | Oxore <oxore@protonmail.com> | 2023-08-01 22:04:37 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2023-08-01 22:04:37 +0300 |
commit | ce039cad28945e23c89b193bb24cb63c06963640 (patch) | |
tree | a61b4f4d1e3463b1307eff1807615017231a8bcb /src | |
parent | 1f322b962c39121dea4f8712ce67d47a9b1f35af (diff) |
Fix figure placement one more time
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index f670989..57da584 100644 --- a/src/main.rs +++ b/src/main.rs @@ -355,6 +355,8 @@ impl Game { self.y -= 1; if self.field.has_collision(&self.figure, self.x, self.y - 1) { self.start_place_timeout(); + } else { + self.stop_place_timeout(); } } self.reset_fall_timeout(); @@ -367,7 +369,7 @@ impl Game { }; let advance_figure_result = if let Some(t) = &self.place_timeout { if t.is_elapsed() { - self.place_figure(); + self.advance_figure(); Some(StepResult::StateChanged) } else { None |