[BUGFIX] Fixed revenant malfunction ability not working properly only MediBots and Stasis bed (#38664)

* fixed

* clean up

* orks fix smart

* review fix 1

* more requested changes

* less cursed

* more descriptive description

* better wording
This commit is contained in:
Velken
2025-07-04 02:08:45 -03:00
committed by GitHub
parent a2ac401db3
commit e82064916a
3 changed files with 13 additions and 8 deletions

View File

@@ -51,9 +51,9 @@ public sealed class EmagSystem : EntitySystem
}
/// <summary>
/// Does the emag effect on a specified entity
/// Does the emag effect on a specified entity with a specified EmagType. The optional field customEmagType can be used to override the emag type defined in the component.
/// </summary>
public bool TryEmagEffect(Entity<EmagComponent?> ent, EntityUid user, EntityUid target)
public bool TryEmagEffect(Entity<EmagComponent?> ent, EntityUid user, EntityUid target, EmagType? customEmagType = null)
{
if (!Resolve(ent, ref ent.Comp, false))
return false;
@@ -68,7 +68,9 @@ public sealed class EmagSystem : EntitySystem
return false;
}
var emaggedEvent = new GotEmaggedEvent(user, ent.Comp.EmagType);
var typeToUse = customEmagType ?? ent.Comp.EmagType;
var emaggedEvent = new GotEmaggedEvent(user, typeToUse);
RaiseLocalEvent(target, ref emaggedEvent);
if (!emaggedEvent.Handled)
@@ -78,7 +80,7 @@ public sealed class EmagSystem : EntitySystem
_audio.PlayPredicted(ent.Comp.EmagSound, ent, ent);
_adminLogger.Add(LogType.Emag, LogImpact.High, $"{ToPrettyString(user):player} emagged {ToPrettyString(target):target} with flag(s): {ent.Comp.EmagType}");
_adminLogger.Add(LogType.Emag, LogImpact.High, $"{ToPrettyString(user):player} emagged {ToPrettyString(target):target} with flag(s): {typeToUse}");
if (emaggedEvent.Handled)
_sharedCharges.TryUseCharge(chargesEnt);
@@ -87,7 +89,7 @@ public sealed class EmagSystem : EntitySystem
{
EnsureComp<EmaggedComponent>(target, out var emaggedComp);
emaggedComp.EmagType |= ent.Comp.EmagType;
emaggedComp.EmagType |= typeToUse;
Dirty(target, emaggedComp);
}
@@ -129,9 +131,10 @@ public sealed class EmagSystem : EntitySystem
[Flags]
[Serializable, NetSerializable]
public enum EmagType : byte
public enum EmagType
{
None = 0,
All = ~None,
Interaction = 1 << 1,
Access = 1 << 2
}