From 77128f54f87b3cdf419875803d08d530ed22519c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 9 Sep 2022 08:49:05 +0200 Subject: [PATCH] adjust bite award logic --- files/helpers/awards.py | 1 + files/routes/awards.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/files/helpers/awards.py b/files/helpers/awards.py index 84d41f29f..f3a6d1b24 100644 --- a/files/helpers/awards.py +++ b/files/helpers/awards.py @@ -72,6 +72,7 @@ def award_timers(v, bot=False): if v.old_house: notify_if_not_bot("Your vampire status has ended!") v.house = v.old_house + v.old_house = None badge = v.has_badge(168) if badge: g.db.delete(badge) diff --git a/files/routes/awards.py b/files/routes/awards.py index 8631d9716..5f2d05e2a 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -358,11 +358,14 @@ def award_thing(v, thing_type, id): g.db.add(thing) elif "Vampire" in kind and kind == v.house: if author.bite: author.bite += 86400 * 7 - else: - author.bite = int(time.time()) + 86400 * 7 + else: author.bite = int(time.time()) + 86400 * 7 + + if not author.old_house: author.old_house = author.house - author.house = 'Vampire' + if 'Vampire' not in author.house: + author.house = 'Vampire' + badge_grant(user=author, badge_id=168) elif "Racist" in kind and kind == v.house: if author.earlylife: author.earlylife += 86400