disposal emag fix and refactoring (#19790)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -542,7 +542,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
if (entry == default || component is not DisposalUnitComponent sDisposals)
|
||||
{
|
||||
component.Engaged = false;
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -550,7 +550,10 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
|
||||
_disposalTubeSystem.TryInsert(entry, sDisposals, beforeFlushArgs.Tags);
|
||||
|
||||
component.NextPressurized = GameTiming.CurTime + TimeSpan.FromSeconds(1f / PressurePerSecond);
|
||||
component.NextPressurized = GameTiming.CurTime;
|
||||
if (!component.DisablePressure)
|
||||
component.NextPressurized += TimeSpan.FromSeconds(1f / PressurePerSecond);
|
||||
|
||||
component.Engaged = false;
|
||||
// stop queuing NOW
|
||||
component.NextFlush = null;
|
||||
@@ -558,7 +561,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
UpdateVisualState(uid, component, true);
|
||||
UpdateInterface(uid, component, component.Powered);
|
||||
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -674,7 +677,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
component.RecentlyEjected.Add(toRemove);
|
||||
|
||||
UpdateVisualState(uid, component);
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
public bool CanFlush(EntityUid unit, SharedDisposalUnitComponent component)
|
||||
@@ -689,7 +692,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
component.Engaged = true;
|
||||
UpdateVisualState(uid, component);
|
||||
UpdateInterface(uid, component, component.Powered);
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
|
||||
if (!CanFlush(uid, component))
|
||||
return;
|
||||
@@ -713,7 +716,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
|
||||
UpdateVisualState(uid, component);
|
||||
UpdateInterface(uid, component, component.Powered);
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user