- fix: Fix offering rune part 2. (#275)
This commit is contained in:
@@ -175,7 +175,9 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
|||||||
|
|
||||||
if (TryComp<ActorComponent>(uid, out var actor))
|
if (TryComp<ActorComponent>(uid, out var actor))
|
||||||
{
|
{
|
||||||
cultistsRule.CultistsCache.Add(MetaData(uid).EntityName, actor.PlayerSession.Name);
|
var name = MetaData(uid).EntityName;
|
||||||
|
if (!cultistsRule.CultistsCache.ContainsKey(name))
|
||||||
|
cultistsRule.CultistsCache.Add(name, actor.PlayerSession.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateCultistsAppearance(cultistsRule);
|
UpdateCultistsAppearance(cultistsRule);
|
||||||
@@ -451,12 +453,15 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cultistComponent = new CultistRoleComponent
|
if (!_roleSystem.MindHasRole<CultistRoleComponent>(mindId))
|
||||||
{
|
{
|
||||||
PrototypeId = cultistRule.CultistRolePrototype
|
var cultistComponent = new CultistRoleComponent
|
||||||
};
|
{
|
||||||
|
PrototypeId = cultistRule.CultistRolePrototype
|
||||||
|
};
|
||||||
|
|
||||||
_roleSystem.MindAddRole(mindId, cultistComponent, mind);
|
_roleSystem.MindAddRole(mindId, cultistComponent, mind);
|
||||||
|
}
|
||||||
EnsureComp<CultistComponent>(playerEntity);
|
EnsureComp<CultistComponent>(playerEntity);
|
||||||
|
|
||||||
_factionSystem.RemoveFaction(playerEntity, "NanoTrasen", false);
|
_factionSystem.RemoveFaction(playerEntity, "NanoTrasen", false);
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using Content.Server.Objectives.Components;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
|
using Content.Server.Roles;
|
||||||
using Content.Server.Stunnable;
|
using Content.Server.Stunnable;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared._White.Cult;
|
|
||||||
using Content.Shared._White.Cult.Components;
|
using Content.Shared._White.Cult.Components;
|
||||||
|
using Content.Shared.Mind;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.Containers;
|
using Robust.Server.Containers;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -69,5 +71,20 @@ public sealed partial class DeconvertCultist : ReagentEffect
|
|||||||
|
|
||||||
entityManager.RemoveComponent<CultistComponent>(uid);
|
entityManager.RemoveComponent<CultistComponent>(uid);
|
||||||
entityManager.RemoveComponent<PentagramComponent>(uid);
|
entityManager.RemoveComponent<PentagramComponent>(uid);
|
||||||
|
|
||||||
|
var mindSystem = entityManager.System<SharedMindSystem>();
|
||||||
|
var roleSystem = entityManager.System<RoleSystem>();
|
||||||
|
|
||||||
|
if (!mindSystem.TryGetMind(uid, out var mindId, out var mind))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var objectives = mind.Objectives.FindAll(entityManager.HasComponent<PickCultTargetComponent>);
|
||||||
|
foreach (var obj in objectives)
|
||||||
|
{
|
||||||
|
mindSystem.TryRemoveObjective(mindId, mind, mind.Objectives.IndexOf(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (roleSystem.MindHasRole<CultistRoleComponent>(mindId))
|
||||||
|
roleSystem.MindRemoveRole<CultistRoleComponent>(mindId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user