From 59ceb133298142517e902d5e55b823aab4bfe092 Mon Sep 17 00:00:00 2001 From: skizzerz Date: Tue, 26 Jun 2018 11:09:05 -0500 Subject: [PATCH] Sleepy bug fix Don't error if someone tries to move after having gotten out of a nightmare. Also use clear instead of del because I thought that it may have been an issue but it turned out to have been fine but I'm too lazy to revert it and it doesn't change anything. --- src/gamemodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gamemodes.py b/src/gamemodes.py index a0ed12a..8c9b3a6 100644 --- a/src/gamemodes.py +++ b/src/gamemodes.py @@ -976,7 +976,7 @@ class SleepyMode(GameMode): elif self.step == 3: if "correct" in self.on_path: self.having_nightmare[0].send(messages["sleepy_nightmare_wake"]) - del self.having_nightmare[0] + self.having_nightmare.clear() elif "fake1" in self.on_path: self.having_nightmare[0].send(messages["sleepy_nightmare_fake_1"]) self.step = 0 @@ -991,7 +991,7 @@ class SleepyMode(GameMode): self.nightmare_step() def move(self, direction, var, wrapper, message): - if self.having_nightmare[0] is not wrapper.source: + if not self.having_nightmare or self.having_nightmare[0] is not wrapper.source: return opposite = {"n": "s", "e": "w", "s": "n", "w": "e"} if self.prev_direction == opposite[direction]: