private void OnMapInit(Entity<PowerCellDrawComponent> ent, ref MapInitEvent args)
{
- QueueUpdate((ent, ent.Comp));
+ ent.Comp.NextUpdateTime = Timing.CurTime + ent.Comp.Delay;
}
private void OnRejuvenate(EntityUid uid, PowerCellSlotComponent component, RejuvenateEvent args)
RaiseLocalEvent(uid, new PowerCellChangedEvent(true), false);
}
- /// <summary>
- /// Makes the draw logic update in the next tick.
- /// </summary>
- public void QueueUpdate(Entity<PowerCellDrawComponent?> ent)
- {
- if (Resolve(ent, ref ent.Comp))
- ent.Comp.NextUpdateTime = Timing.CurTime;
- }
-
public void SetDrawEnabled(Entity<PowerCellDrawComponent?> ent, bool enabled)
{
if (!Resolve(ent, ref ent.Comp, false) || ent.Comp.Enabled == enabled)
return;
+ if (enabled)
+ ent.Comp.NextUpdateTime = Timing.CurTime;
+
ent.Comp.Enabled = enabled;
Dirty(ent, ent.Comp);
}