aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-07-30 14:39:55 -0600
committerSelene ToyKeeper2019-07-30 14:39:55 -0600
commitba961635820f16e4726bf19bfb012aa7d7876c47 (patch)
treec1fc567f728792e5239e813ec2120daa4d742339
parentmerged Mateminco MF01S / MT18 branch, adding support for the new light (diff)
downloadanduril-ba961635820f16e4726bf19bfb012aa7d7876c47.tar.gz
anduril-ba961635820f16e4726bf19bfb012aa7d7876c47.tar.bz2
anduril-ba961635820f16e4726bf19bfb012aa7d7876c47.zip
ensure muggle thermal step-down can't overflow or wrap around
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/anduril.c2
1 files changed, 1 insertions, 1 deletions
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;