using Content.Server.NPC.Components;
using Content.Server.NPC.HTN;
using Content.Shared.CCVar;
+using Content.Shared.Mind;
+using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Systems;
using Content.Shared.NPC;
if (_mobState.IsIncapacitated(uid) || TerminatingOrDeleted(uid))
return;
+ // This NPC has an attached mind, so it should not wake up.
+ if (TryComp<MindContainerComponent>(uid, out var mindContainer) && mindContainer.HasMind)
+ return;
+
WakeNPC(uid, component);
}
/// <param name="target">the entity being zombified</param>
/// <param name="mobState"></param>
/// <remarks>
- /// ALRIGHT BIG BOY. YOU'VE COME TO THE LAYER OF THE BEAST. THIS IS YOUR WARNING.
+ /// ALRIGHT BIG BOYS, GIRLS AND ANYONE ELSE. YOU'VE COME TO THE LAYER OF THE BEAST. THIS IS YOUR WARNING.
/// This function is the god function for zombie stuff, and it is cursed. I have
/// attempted to label everything thouroughly for your sanity. I have attempted to
/// rewrite this, but this is how it shall lie eternal. Turn back now.
_identity.QueueIdentityUpdate(target);
+ var htn = EnsureComp<HTNComponent>(target);
+ htn.RootTask = new HTNCompoundTask() { Task = "SimpleHostileCompound" };
+ htn.Blackboard.SetValue(NPCBlackboard.Owner, target);
+ _npc.SleepNPC(target, htn);
+
//He's gotta have a mind
var hasMind = _mind.TryGetMind(target, out var mindId, out _);
if (hasMind && _mind.TryGetSession(mindId, out var session))
}
else
{
- var htn = EnsureComp<HTNComponent>(target);
- htn.RootTask = new HTNCompoundTask() { Task = "SimpleHostileCompound" };
- htn.Blackboard.SetValue(NPCBlackboard.Owner, target);
_npc.WakeNPC(target, htn);
}