Do not wake up NPC if there is still a mind attached. (#27651)

* Do not wake up NPC if there is still a mind attached.

This became apparent with diona nymphs (?) and slime gyras (?). This caused players that disconnected while a nymph, gyras or other npc to resume their NPC behavior. Which I would call unwanted. This fixes that.

* Zombies become AI anyway

* Update Content.Server/NPC/Systems/NPCSystem.cs

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
Vasilis
2024-05-11 18:01:28 +03:00
committed by GitHub
parent 8366c743f2
commit b860774d7c
2 changed files with 12 additions and 4 deletions

View File

@@ -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<MindContainerComponent>(uid, out var mindContainer) && mindContainer.HasMind)
return;
WakeNPC(uid, component);
}