mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 12:47:16 +01:00
Adds limit to prevent random walking below the lower limit temperature, too.
This commit is contained in:
@@ -217,7 +217,8 @@
|
||||
//limit temperature increase so that it cannot raise temperature above upper_limit,
|
||||
//or if it is already above upper_limit, limit the increase to 0.
|
||||
var/inc_limit = max(upper_limit - temperature, 0)
|
||||
temperature += min(rand(-7 + bias, 7 + bias), inc_limit)
|
||||
var/dec_limit = min(temperature - lower_limit, 0)
|
||||
temperature += between(dec_limit, rand(-7 + bias, 7 + bias), inc_limit)
|
||||
|
||||
if (temperature > max_temperature)
|
||||
overheat()
|
||||
|
||||
Reference in New Issue
Block a user