Mana no longer regenerates after death (#1027)

* Update CP14MagicEnergySystem.Draw.cs

* :nerd:

* Update CP14MagicEnergySystem.Draw.cs

* Update CP14MagicEnergySystem.Draw.cs

* oops...

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
Link
2025-03-28 11:10:42 +03:00
committed by GitHub
parent 532f44eb3c
commit b9fad6cbd4

View File

@@ -1,12 +1,16 @@
using Content.Server._CP14.MagicEnergy.Components;
using Content.Shared._CP14.MagicEnergy.Components;
using Content.Shared.Damage;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Map.Components;
namespace Content.Server._CP14.MagicEnergy;
public partial class CP14MagicEnergySystem
{
[Dependency] private readonly MobStateSystem _mobState = default!;
private void InitializeDraw()
{
SubscribeLocalEvent<CP14MagicEnergyDrawComponent, MapInitEvent>(OnDrawMapInit);
@@ -52,6 +56,9 @@ public partial class CP14MagicEnergySystem
if (draw.NextUpdateTime >= _gameTiming.CurTime)
continue;
if (TryComp<MobStateComponent>(uid, out var mobState) && !_mobState.IsAlive(uid, mobState))
continue;
draw.NextUpdateTime = _gameTiming.CurTime + TimeSpan.FromSeconds(draw.Delay);
ChangeEnergy(uid, draw.Energy, out _, out _, magicContainer, draw.Safe);
@@ -63,6 +70,9 @@ public partial class CP14MagicEnergySystem
if (draw.NextUpdateTime >= _gameTiming.CurTime)
continue;
if (TryComp<MobStateComponent>(uid, out var mobState) && !_mobState.IsAlive(uid, mobState))
continue;
draw.NextUpdateTime = _gameTiming.CurTime + TimeSpan.FromSeconds(draw.Delay);
var daylight = false;