From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Sun, 23 Feb 2025 00:52:48 +0000 (+0100) Subject: [HOTFIX] Altered Silicon removal fails to trigger role update (#35399) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=1d655f67122cb0d8466b149916432507a37efd12;p=space-station-14.git [HOTFIX] Altered Silicon removal fails to trigger role update (#35399) minor sharedrolesystem refactor --- diff --git a/Content.Shared/Roles/SharedRoleSystem.cs b/Content.Shared/Roles/SharedRoleSystem.cs index 89cd95c2ea..d624bc512e 100644 --- a/Content.Shared/Roles/SharedRoleSystem.cs +++ b/Content.Shared/Roles/SharedRoleSystem.cs @@ -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,