diff --git a/Content.Server/NPC/Systems/NPCSystem.cs b/Content.Server/NPC/Systems/NPCSystem.cs index 9108629435..bc21916976 100644 --- a/Content.Server/NPC/Systems/NPCSystem.cs +++ b/Content.Server/NPC/Systems/NPCSystem.cs @@ -2,6 +2,8 @@ using System.Diagnostics.CodeAnalysis; 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; @@ -49,6 +51,10 @@ namespace Content.Server.NPC.Systems if (_mobState.IsIncapacitated(uid) || TerminatingOrDeleted(uid)) return; + // This NPC has an attached mind, so it should not wake up. + if (TryComp(uid, out var mindContainer) && mindContainer.HasMind) + return; + WakeNPC(uid, component); } diff --git a/Content.Server/Zombies/ZombieSystem.Transform.cs b/Content.Server/Zombies/ZombieSystem.Transform.cs index 23e1c2bb92..a2c13ed71c 100644 --- a/Content.Server/Zombies/ZombieSystem.Transform.cs +++ b/Content.Server/Zombies/ZombieSystem.Transform.cs @@ -79,7 +79,7 @@ namespace Content.Server.Zombies /// the entity being zombified /// /// - /// 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. @@ -226,6 +226,11 @@ namespace Content.Server.Zombies _identity.QueueIdentityUpdate(target); + var htn = EnsureComp(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)) @@ -241,9 +246,6 @@ namespace Content.Server.Zombies } else { - var htn = EnsureComp(target); - htn.RootTask = new HTNCompoundTask() { Task = "SimpleHostileCompound" }; - htn.Blackboard.SetValue(NPCBlackboard.Owner, target); _npc.WakeNPC(target, htn); }