From 064918acd0ed69e3b1294771a786ec1019e834d2 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 23 Apr 2023 04:42:25 +0200 Subject: [PATCH] fix vamp bug --- files/helpers/awards.py | 9 ++++----- files/routes/awards.py | 13 +++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/files/helpers/awards.py b/files/helpers/awards.py index c497b1d25c..4f66b947ad 100644 --- a/files/helpers/awards.py +++ b/files/helpers/awards.py @@ -70,11 +70,10 @@ def award_timers(v, bot=False): v.bite = None badge = v.has_badge(168) if badge: g.db.delete(badge) - - if "Vampire" not in v.old_house: - v.house = v.old_house - v.old_house = '' - notify_if_not_bot(f"Your vampire status has ended. You're now back in House {v.old_house.replace(' Founder', '')}!") + + v.house = v.old_house + notify_if_not_bot(f"Your vampire status has ended. You're now back in House {v.old_house.replace(' Founder', '')}!") + v.old_house = '' if v.earlylife and v.earlylife < now: v.earlylife = None diff --git a/files/routes/awards.py b/files/routes/awards.py index f3dc62cccd..bf7ea25675 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -409,12 +409,13 @@ def award_thing(v, thing_type, id): g.db.add(thing) elif "Vampire" in kind and kind == v.house: if author.bite: author.bite += 172800 - else: author.bite = int(time.time()) + 172800 - - if 'Vampire' not in author.house: - if not author.old_house: - author.old_house = author.house - author.house = 'Vampire' + else: + if v.house.startswith("Vampire"): + abort(400, f"{safe_username} is already a permanent vampire!") + + author.bite = int(time.time()) + 172800 + v.old_house = v.house + v.house = "Vampire" badge_grant(user=author, badge_id=168) elif "Racist" in kind and kind == v.house: