mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
fix: APC sprites stuck in fully drained states on round start (#42852)
* Fix APC incorrect charge state caused by race condition on map startup * fix: Defer the update from ChargeChangedEvent to next tick
This commit is contained in:
@@ -87,7 +87,8 @@ public sealed class ApcSystem : EntitySystem
|
||||
// Change the APC's state only when the battery state changes, or when it's first created.
|
||||
private void OnBatteryChargeChanged(EntityUid uid, ApcComponent component, ref ChargeChangedEvent args)
|
||||
{
|
||||
UpdateApcState(uid, component);
|
||||
// Defer until the next tick.
|
||||
component.NeedStateUpdate = true;
|
||||
}
|
||||
|
||||
private static void OnApcStartup(EntityUid uid, ApcComponent component, ComponentStartup args)
|
||||
|
||||
Reference in New Issue
Block a user