From 2b56061cb7c6c4e1435a3d0020ad6b250d770d78 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sun, 29 Mar 2026 04:28:33 -0500 Subject: [PATCH] fix(Core/Combat): Restrict NullCreatureAI combat disallow to triggers only (#25289) Co-authored-by: blinkysc --- .../updates/pending_db_world/rev_1774759571712435204.sql | 2 ++ src/server/game/AI/CoreAI/PassiveAI.cpp | 5 +++-- src/server/scripts/World/npcs_special.cpp | 8 +------- 3 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1774759571712435204.sql diff --git a/data/sql/updates/pending_db_world/rev_1774759571712435204.sql b/data/sql/updates/pending_db_world/rev_1774759571712435204.sql new file mode 100644 index 000000000..b12f5a30b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1774759571712435204.sql @@ -0,0 +1,2 @@ +-- Fix Ashtongue Channeler saved health (was incorrectly 1) +UPDATE `creature` SET `curhealth` = 87973 WHERE `id1` = 23421; diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index 79ac51fa8..69fa69de0 100644 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -23,8 +23,9 @@ PossessedAI::PossessedAI(Creature* c) : CreatureAI(c) { me->SetReactState(REACT_ NullCreatureAI::NullCreatureAI(Creature* c) : CreatureAI(c) { me->SetReactState(REACT_PASSIVE); - // TODO: Remove once WorldObject casting is ported (triggers won't create combat refs from spell casts) - me->SetIsCombatDisallowed(true); + // TODO: Remove once WorldObject spell casting is ported (triggers won't create combat refs from spell casts) + if (me->IsTrigger()) + me->SetIsCombatDisallowed(true); } int32 NullCreatureAI::Permissible(Creature const* creature) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 3ddb27669..3e7ebb34e 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -314,11 +314,7 @@ public: struct npc_training_dummy : NullCreatureAI { - npc_training_dummy(Creature* creature) : NullCreatureAI(creature) - { - // TODO: Remove once WorldObject casting is ported - me->SetIsCombatDisallowed(false); - } + npc_training_dummy(Creature* creature) : NullCreatureAI(creature) { } void JustEnteredCombat(Unit* who) override { @@ -363,8 +359,6 @@ struct npc_target_dummy : NullCreatureAI { npc_target_dummy(Creature* creature) : NullCreatureAI(creature) { - // TODO: Remove once WorldObject casting is ported - me->SetIsCombatDisallowed(false); _deathTimer = 15s; }