split temperature protection into heating and cooling (#30662)

* split temperature protection into heating and cooling

* fugg

* weh
This commit is contained in:
Nemanja
2024-09-07 01:37:17 -04:00
committed by GitHub
parent 9ba59d9636
commit a197baac17
15 changed files with 68 additions and 32 deletions

View File

@@ -299,7 +299,11 @@ public sealed class TemperatureSystem : EntitySystem
private void OnTemperatureChangeAttempt(EntityUid uid, TemperatureProtectionComponent component,
InventoryRelayedEvent<ModifyChangedTemperatureEvent> args)
{
var ev = new GetTemperatureProtectionEvent(component.Coefficient);
var coefficient = args.Args.TemperatureDelta < 0
? component.CoolingCoefficient
: component.HeatingCoefficient;
var ev = new GetTemperatureProtectionEvent(coefficient);
RaiseLocalEvent(uid, ref ev);
args.Args.TemperatureDelta *= ev.Coefficient;