Some cult fixes

This commit is contained in:
Aviu00
2024-01-28 09:11:36 +03:00
parent 5cec339558
commit cff24101b0
3 changed files with 6 additions and 5 deletions

View File

@@ -410,14 +410,15 @@ public sealed partial class CultSystem : EntitySystem
if (state.CurrentState != MobState.Dead)
{
var canBeConverted = _entityManager.TryGetComponent<MindContainerComponent>(victim.Value, out var mind) && mind.HasMind;
var canBeConverted = _entityManager.TryGetComponent<MindContainerComponent>(victim.Value, out var mind) &&
mind is {Mind: { }};
// Проверка, является ли жертва целью
_entityManager.TryGetComponent<MindContainerComponent>(target?.CurrentEntity, out var targetMind);
var isTarget = mind != null && mind.Mind!.Value == targetMind?.Mind!.Value;
var isTarget = mind!.Mind!.Value == targetMind?.Mind!.Value;
var jobAllowConvert = true;
if(_jobSystem.MindTryGetJob(mind!.Mind!.Value, out var _, out var prototype))
if(_jobSystem.MindTryGetJob(mind.Mind!.Value, out var _, out var prototype))
{
jobAllowConvert = prototype.CanBeAntag;
}