From 79331e17ac5ce9e0dbf071d64a82072089449318 Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Tue, 19 Jul 2011 16:26:27 -0700 Subject: [PATCH] Bug fix: Only send NOTICEs to randomEncounter of options change --- pesterchum.py | 2 ++ randomer.py | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pesterchum.py b/pesterchum.py index fa73763..80c1e00 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -609,6 +609,8 @@ class userProfile(object): self.quirks = quirks self.userprofile["quirks"] = self.quirks.plainList() self.save() + def getRandom(self): + return self.randoms def setRandom(self, random): self.randoms = random self.userprofile["randoms"] = random diff --git a/randomer.py b/randomer.py index 4c89b47..54c2c7f 100644 --- a/randomer.py +++ b/randomer.py @@ -14,10 +14,11 @@ class RandomHandler(QtCore.QObject): self.mainwindow.sendNotice.emit("?", self.randNick) def setRandomer(self, r): - if r: code = "+" - else: code = "-" - self.queue.append(code) - self.mainwindow.sendNotice.emit(code, self.randNick) + if r != self.mainwindow.userprofile.getRandom(): + if r: code = "+" + else: code = "-" + self.queue.append(code) + self.mainwindow.sendNotice.emit(code, self.randNick) @QtCore.pyqtSlot() def getEncounter(self):