Skip to content

Commit

Permalink
фикс дублирования дохлых ролей
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Dec 14, 2024
1 parent 6f13668 commit 4fac0d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Content.Server/Ghost/Roles/GhostRoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using Content.Shared.Verbs;
using Robust.Shared.Collections;
using Content.Shared.Ghost.Roles.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Roles.Jobs;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors

Expand All @@ -55,6 +56,7 @@ public sealed class GhostRoleSystem : EntitySystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;

private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors

Expand Down Expand Up @@ -669,6 +671,11 @@ private void OnMindRemoved(EntityUid uid, GhostTakeoverAvailableComponent compon
if (!ghostRole.ReregisterOnGhost || component.LifeStage > ComponentLifeStage.Running)
return;

// Sunrise-Start
if (!_mobState.IsAlive(uid))
return;
// Sunrise-End

ghostRole.Taken = false;
RegisterGhostRole((uid, ghostRole));
}
Expand Down

0 comments on commit 4fac0d3

Please sign in to comment.