From ba961635820f16e4726bf19bfb012aa7d7876c47 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 30 Jul 2019 14:39:55 -0600 Subject: ensure muggle thermal step-down can't overflow or wrap around --- spaghetti-monster/anduril/anduril.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index c2a4b77..24211d7 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -1846,7 +1846,7 @@ uint8_t muggle_state(Event event, uint16_t arg) { blip(); #endif // step down proportional to the amount of overheating - uint8_t new = actual_level - arg; + int16_t new = actual_level - arg; if (new < MUGGLE_FLOOR) { new = MUGGLE_FLOOR; } set_level(new); return MISCHIEF_MANAGED; -- cgit v1.2.3