mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
Fixes the unstable quirk (#49309)
* Fixes mood 100% super duper for real this time * fixes mood for real, removes a bit of convoluted code.
This commit is contained in:
@@ -192,15 +192,12 @@
|
||||
|
||||
///Sets sanity to the specified amount and applies effects.
|
||||
/datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_GREAT, override = FALSE)
|
||||
// If we're out of the acceptable minimum-maximum range move back towards it in steps of 0.5
|
||||
// If we're out of the acceptable minimum-maximum range move back towards it in steps of 0.7
|
||||
// If the new amount would move towards the acceptable range faster then use it instead
|
||||
if(amount < minimum)
|
||||
amount += CLAMP(minimum - sanity, 0, 0.7)
|
||||
else
|
||||
if(!override && HAS_TRAIT(parent, TRAIT_UNSTABLE))
|
||||
maximum = sanity
|
||||
if(amount > maximum)
|
||||
amount = min(maximum, sanity)
|
||||
amount += clamp(minimum - amount, 0, 0.7)
|
||||
if((!override && HAS_TRAIT(parent, TRAIT_UNSTABLE)) || amount > maximum)
|
||||
amount = min(sanity, amount)
|
||||
if(amount == sanity) //Prevents stuff from flicking around.
|
||||
return
|
||||
sanity = amount
|
||||
|
||||
Reference in New Issue
Block a user