From 645da5a3f9baf6c8f8d106f2c975686f2f90f62b Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 25 Nov 2025 13:39:25 +0100 Subject: Core/Movement: Remove deprecated jump functions and update SAI scripts using them --- src/server/game/Movement/MotionMaster.cpp | 82 ------------------------------- 1 file changed, 82 deletions(-) (limited to 'src/server/game/Movement/MotionMaster.cpp') diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index be58d1a3828..af61fd0a27f 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -859,47 +859,6 @@ void MotionMaster::MoveKnockbackFrom(Position const& origin, float speedXY, floa Add(movement); } -void MotionMaster::MoveJump_OLD_DEPRECATED(Position const& pos, float speedXY, float speedZ, uint32 id /*= EVENT_JUMP*/, MovementFacingTarget const& facing /*= {}*/, - bool orientationFixed /*= false*/, JumpArrivalCastArgs const* arrivalCast /*= nullptr*/, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/, - Optional>&& scriptResult /*= {}*/) -{ - TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveJump: '{}', jumps to point Id: {} ({})", _owner->GetGUID(), id, pos.ToString()); - if (speedXY < 0.01f) - { - if (scriptResult) - scriptResult->SetResult(MovementStopReason::Interrupted); - return; - } - - float moveTimeHalf = speedZ / Movement::gravity; - float max_height = -Movement::computeFallElevation(moveTimeHalf, false, -speedZ); - - std::function initializer = [=, effect = (spellEffectExtraData ? Optional(*spellEffectExtraData) : Optional())](Movement::MoveSplineInit& init) - { - init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false); - init.SetParabolic(max_height, 0); - init.SetVelocity(speedXY); - std::visit(Movement::MoveSplineInitFacingVisitor(init), facing); - init.SetJumpOrientationFixed(orientationFixed); - if (effect) - init.SetSpellEffectExtraData(*effect); - }; - - uint32 arrivalSpellId = 0; - ObjectGuid arrivalSpellTargetGuid; - if (arrivalCast) - { - arrivalSpellId = arrivalCast->SpellId; - arrivalSpellTargetGuid = arrivalCast->Target; - } - - GenericMovementGenerator* movement = new GenericMovementGenerator(std::move(initializer), EFFECT_MOTION_TYPE, id, - { .ArrivalSpellId = arrivalSpellId, .ArrivalSpellTarget = arrivalSpellTargetGuid, .ScriptResult = std::move(scriptResult) }); - movement->Priority = MOTION_PRIORITY_HIGHEST; - movement->BaseUnitState = UNIT_STATE_JUMPING; - Add(movement); -} - void MotionMaster::MoveJump(uint32 id, Position const& pos, std::variant speedOrTime /*= {}*/, Optional minHeight /*= {}*/, Optional maxHeight /*= {}*/, MovementFacingTarget const& facing /*= {}*/, bool orientationFixed, bool unlimitedSpeed /*= false*/, Optional speedMultiplier /*= {}*/, @@ -976,47 +935,6 @@ void MotionMaster::MoveJump(uint32 id, Position const& pos, std::variant>&& scriptResult /*= {}*/) -{ - TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveJumpWithGravity: '{}', jumps to point Id: {} ({})", _owner->GetGUID(), id, pos.ToString()); - if (speedXY < 0.01f) - { - if (scriptResult) - scriptResult->SetResult(MovementStopReason::Interrupted); - return; - } - - std::function initializer = [=, effect = (spellEffectExtraData ? Optional(*spellEffectExtraData) : Optional())](Movement::MoveSplineInit& init) - { - init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false); - init.SetParabolicVerticalAcceleration(gravity, 0); - init.SetUncompressed(); - init.SetVelocity(speedXY); - init.SetUnlimitedSpeed(); - std::visit(Movement::MoveSplineInitFacingVisitor(init), facing); - init.SetJumpOrientationFixed(orientationFixed); - if (effect) - init.SetSpellEffectExtraData(*effect); - }; - - uint32 arrivalSpellId = 0; - ObjectGuid arrivalSpellTargetGuid; - if (arrivalCast) - { - arrivalSpellId = arrivalCast->SpellId; - arrivalSpellTargetGuid = arrivalCast->Target; - } - - GenericMovementGenerator* movement = new GenericMovementGenerator(std::move(initializer), EFFECT_MOTION_TYPE, id, - { .ArrivalSpellId = arrivalSpellId, .ArrivalSpellTarget = arrivalSpellTargetGuid, .ScriptResult = std::move(scriptResult) }); - movement->Priority = MOTION_PRIORITY_HIGHEST; - movement->BaseUnitState = UNIT_STATE_JUMPING; - movement->AddFlag(MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH); - Add(movement); -} - void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount, Optional duration /*= {}*/, Optional speed /*= {}*/, MovementWalkRunSpeedSelectionMode speedSelectionMode /*= MovementWalkRunSpeedSelectionMode::Default*/, -- cgit v1.2.3