Action charges refactor (#33993)
* Action charges refactor - Fixes the slight godmoding of baseactioncomponent. - Gets back 1ms of server time. * chorg * Remove FrameUpdate * Fixes * More fixes * Combine * Fixes * Updates * weh * Last fixes * weh * Fix naughty * YAML fixes * This one too * Merge conflicts * This thing * Review * Fix this as well * Icon fix * weh * Review * Review * seamless * Review
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Content.Server.Flash
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly AudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedChargesSystem _charges = default!;
|
||||
[Dependency] private readonly SharedChargesSystem _sharedCharges = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examine = default!;
|
||||
@@ -86,15 +86,15 @@ namespace Content.Server.Flash
|
||||
return false;
|
||||
|
||||
TryComp<LimitedChargesComponent>(uid, out var charges);
|
||||
if (_charges.IsEmpty(uid, charges))
|
||||
if (_sharedCharges.IsEmpty((uid, charges)))
|
||||
return false;
|
||||
|
||||
_charges.UseCharge(uid, charges);
|
||||
_sharedCharges.TryUseCharge((uid, charges));
|
||||
_audio.PlayPvs(comp.Sound, uid);
|
||||
comp.Flashing = true;
|
||||
_appearance.SetData(uid, FlashVisuals.Flashing, true);
|
||||
|
||||
if (_charges.IsEmpty(uid, charges))
|
||||
if (_sharedCharges.IsEmpty((uid, charges)))
|
||||
{
|
||||
_appearance.SetData(uid, FlashVisuals.Burnt, true);
|
||||
_tag.AddTag(uid, TrashTag);
|
||||
|
||||
Reference in New Issue
Block a user