meat rotting hotfix (#18760)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-08-07 12:13:35 +01:00
committed by GitHub
parent fd1c131420
commit 3e64676dbd
2 changed files with 8 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ public sealed class RottingSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<PerishableComponent, MapInitEvent>(OnPerishableMapInit);
SubscribeLocalEvent<PerishableComponent, EntityUnpausedEvent>(OnPerishableUnpaused);
SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged);
@@ -42,6 +43,11 @@ public sealed class RottingSystem : EntitySystem
SubscribeLocalEvent<TemperatureComponent, IsRottingEvent>(OnTempIsRotting);
}
private void OnPerishableMapInit(EntityUid uid, PerishableComponent component, MapInitEvent args)
{
component.NextPerishUpdate = _timing.CurTime + component.PerishUpdateRate;
}
private void OnPerishableUnpaused(EntityUid uid, PerishableComponent component, ref EntityUnpausedEvent args)
{
component.NextPerishUpdate += args.PausedTime;

View File

@@ -26,6 +26,8 @@
Quantity: 5
- type: Item
size: 5
# let air cook and freeze meat for cooking and preservation
- type: AtmosExposed
- type: Temperature
currentTemperature: 290
- type: Material