Stable merge for hotfix backport (#35412)

This commit is contained in:
Pieter-Jan Briers
2025-02-23 02:15:34 +01:00
committed by GitHub
3 changed files with 20 additions and 14 deletions

View File

@@ -172,14 +172,18 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
});
}
private void EnsureSubvertedSiliconRole(EntityUid mindId)
protected override void EnsureSubvertedSiliconRole(EntityUid mindId)
{
base.EnsureSubvertedSiliconRole(mindId);
if (!_roles.MindHasRole<SubvertedSiliconRoleComponent>(mindId))
_roles.MindAddRole(mindId, "MindRoleSubvertedSilicon", silent: true);
}
private void RemoveSubvertedSiliconRole(EntityUid mindId)
protected override void RemoveSubvertedSiliconRole(EntityUid mindId)
{
base.RemoveSubvertedSiliconRole(mindId);
if (_roles.MindHasRole<SubvertedSiliconRoleComponent>(mindId))
_roles.MindTryRemoveRole<SubvertedSiliconRoleComponent>(mindId);
}
@@ -239,8 +243,10 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
return ev.Laws;
}
public void NotifyLawsChanged(EntityUid uid, SoundSpecifier? cue = null)
public override void NotifyLawsChanged(EntityUid uid, SoundSpecifier? cue = null)
{
base.NotifyLawsChanged(uid, cue);
if (!TryComp<ActorComponent>(uid, out var actor))
return;

View File

@@ -168,11 +168,9 @@ public abstract class SharedRoleSystem : EntitySystem
var update = MindRolesUpdate((mindId, mind));
// RoleType refresh, Role time tracking, Update Admin playerlist
if (mind.OwnedEntity != null)
{
var message = new RoleAddedEvent(mindId, mind, update, silent);
RaiseLocalEvent(mind.OwnedEntity.Value, message, true);
}
var message = new RoleAddedEvent(mindId, mind, update, silent);
RaiseLocalEvent(mindId, message, true);
var name = Loc.GetString(protoEnt.Name);
if (mind.OwnedEntity is not null)
@@ -311,11 +309,8 @@ public abstract class SharedRoleSystem : EntitySystem
var update = MindRolesUpdate(mind);
if (mind.Comp.OwnedEntity != null)
{
var message = new RoleRemovedEvent(mind.Owner, mind.Comp, update);
RaiseLocalEvent(mind.Comp.OwnedEntity.Value, message, true);
}
var message = new RoleRemovedEvent(mind.Owner, mind.Comp, update);
RaiseLocalEvent(mind, message, true);
_adminLogger.Add(LogType.Mind,
LogImpact.Low,

View File

@@ -62,7 +62,7 @@ public abstract partial class SharedSiliconLawSystem : EntitySystem
args.Handled = true;
}
protected virtual void NotifyLawsChanged(EntityUid uid, SoundSpecifier? cue = null)
public virtual void NotifyLawsChanged(EntityUid uid, SoundSpecifier? cue = null)
{
}
@@ -71,6 +71,11 @@ public abstract partial class SharedSiliconLawSystem : EntitySystem
{
}
protected virtual void RemoveSubvertedSiliconRole(EntityUid mindId)
{
}
}
[ByRefEvent]