- fix: Fix offering rune part 2. (#275)

This commit is contained in:
Aviu00
2024-04-08 03:22:48 +09:00
committed by GitHub
parent 3d15c80a23
commit d3086184bd
2 changed files with 28 additions and 6 deletions

View File

@@ -175,7 +175,9 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
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);
@@ -451,12 +453,15 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
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);
_factionSystem.RemoveFaction(playerEntity, "NanoTrasen", false);