Compare commits

...

8 Commits

Author SHA1 Message Date
DealsBeam
8913876988
Merge 7ba22c44c3c4ef2154174a94731abce801445529 into d4cd580ddcf382acbca3bd104f09ca4c39ad811a 2025-11-09 05:51:49 -03:00
github-actions[bot]
d4cd580ddc chore(DB): import pending files
Referenced commit(s): 37833c66e69733c68c4244c2a2070b5c2421f0a8
2025-11-09 08:50:22 +00:00
Andrew
37833c66e6
fix(DB/Creature): Remove xp from Reclamation mobs (#23579) 2025-11-09 05:49:21 -03:00
github-actions[bot]
ec274182a2 chore(DB): import pending files
Referenced commit(s): d9b2e775e3266f4b592ca09eefd99b6f212d1861
2025-11-09 07:58:11 +00:00
Andrew
d9b2e775e3
fix(DB/Creature): Fix Sorlof visibility distance (#23573) 2025-11-09 04:57:04 -03:00
killerwife
c85c86b285
Remove double unroot in Unit::_ExitVehicle (#23545) 2025-11-08 19:40:30 -03:00
sogladev
125e1aec9d
fix(Scripts/AzjolNerub): update Azjol-Nerub's Anub'arak (#23570) 2025-11-08 17:27:56 -03:00
google-labs-jules[bot]
7ba22c44c3 Fix: Distract spell stops target movement
The Distract spell was causing the target to stop moving because it was forcing the target to face the caster. This was happening because the `SetFacingTo` function in `Spell::EffectDistract` was clearing the movement stack.

This commit fixes the bug by removing the call to `SetFacingTo`, which prevents the movement stack from being cleared. A test case has been added to verify that the original movement is not interrupted.
2025-10-30 19:16:48 +00:00
7 changed files with 62 additions and 15 deletions

View File

@ -0,0 +1,3 @@
-- DB update 2025_11_08_02 -> 2025_11_09_00
--
UPDATE `creature_addon` SET `visibilityDistanceType` = 3 WHERE `guid` = 103278;

View File

@ -0,0 +1,3 @@
-- DB update 2025_11_09_00 -> 2025_11_09_01
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|64 WHERE `entry` IN (28220, 28218, 28242, 28103, 28212, 28207, 28170);

View File

@ -19586,12 +19586,6 @@ void Unit::_ExitVehicle(Position const* exitPosition)
sScriptMgr->AnticheatSetUnderACKmount(player);
}
else if (HasUnitMovementFlag(MOVEMENTFLAG_ROOT))
{
WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8);
data << GetPackGUID();
SendMessageToSet(&data, false);
}
// xinef: hack for flameleviathan seat vehicle
VehicleEntry const* vehicleInfo = vehicle->GetVehicleInfo();

View File

@ -2706,7 +2706,6 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/)
if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING))
return;
unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); /// @BUG Causes the player to stop moving.
unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS);
}

View File

@ -133,13 +133,13 @@ struct boss_anub_arak : public BossAI
DoCastSelf(SPELL_IMPALE_PERIODIC, true);
++_submergePhase;
events.Reset();
ScheduleSubmerged();
}
}
void ScheduleEmerged()
{
events.Reset();
events.SetPhase(PHASE_EMERGED);
events.ScheduleEvent(EVENT_CARRION_BEETLES, 6500ms, 0, PHASE_EMERGED);
events.ScheduleEvent(EVENT_LEECHING_SWARM, 20s, 0, PHASE_EMERGED);
@ -148,7 +148,6 @@ struct boss_anub_arak : public BossAI
void ScheduleSubmerged()
{
events.Reset();
events.SetPhase(PHASE_SUBMERGED);
events.ScheduleEvent(EVENT_EMERGE, 60s, 0, PHASE_SUBMERGED);
@ -209,14 +208,13 @@ struct boss_anub_arak : public BossAI
}
}
void JustEngagedWith(Unit* who) override
void JustEngagedWith(Unit* /*who*/) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
events.SetPhase(PHASE_EMERGED);
events.ScheduleEvent(EVENT_CLOSE_DOORS, 5s);
events.ScheduleEvent(EVENT_CLOSE_DOORS, 5s, 0, PHASE_EMERGED);
ScheduleEmerged();
// set up world triggers
@ -288,7 +286,8 @@ struct boss_anub_arak : public BossAI
if (_remainingLargeSummonsBeforeEmerge == 0)
{
events.Reset();
events.ScheduleEvent(EVENT_EMERGE, 5s);
events.SetPhase(PHASE_SUBMERGED);
events.ScheduleEvent(EVENT_EMERGE, 5s, 0, PHASE_SUBMERGED);
}
break;
}
@ -333,10 +332,10 @@ struct boss_anub_arak : public BossAI
DoCastSelf(SPELL_SELF_ROOT, true);
me->DisableRotate(true);
me->SendMovementFlagUpdate();
events.ScheduleEvent(EVENT_ENABLE_ROTATE, 3300ms);
events.ScheduleEvent(EVENT_ENABLE_ROTATE, 3300ms, 0, PHASE_EMERGED);
DoCast(target, SPELL_POUND);
}
events.ScheduleEvent(EVENT_POUND, 18s);
events.ScheduleEvent(EVENT_POUND, 18s, 0, PHASE_EMERGED);
break;
case EVENT_ENABLE_ROTATE:
me->RemoveAurasDueToSpell(SPELL_SELF_ROOT);

View File

@ -14,6 +14,10 @@ CollectSourceFiles(
PRIVATE_SOURCES
)
list(APPEND PRIVATE_SOURCES
"server/game/Spells/SpellEffectsTest.cpp"
)
include_directories(
"mocks"
)

View File

@ -0,0 +1,45 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Mocks/WorldMock.h"
#include "Player.h"
#include "Spell.h"
#include "gtest/gtest.h"
TEST(SpellEffectsTest, DistractDoesNotStopMovement)
{
WorldMock world;
Player* player = new Player(nullptr);
player->Create(sObjectMgr->GenerateLowGuid<HighGuid::Player>(), nullptr);
Unit* target = new Unit(false);
target->Create(sObjectMgr->GenerateLowGuid<HighGuid::Unit>(), nullptr, 0, 0);
target->GetMotionMaster()->MovePoint(1, 10.0f, 10.0f, 10.0f);
// Verify that the target is moving and the stack size is 1
ASSERT_EQ(target->GetMotionMaster()->size(), 1);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(1725); // Distract
Spell* spell = new Spell(player, spellInfo, TriggerCastFlags(TRIGGERED_NONE));
spell->m_targets.SetUnitTarget(target);
spell->EffectDistract(EFFECT_0);
// Verify that the movement stack size is now 2, meaning the original movement was not cleared
EXPECT_EQ(target->GetMotionMaster()->size(), 2);
}