From 596bf2b77218e6b959c1bf7de848c6f09d5a91f0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 23 Jan 2022 20:31:52 +0100 Subject: Core/Misc: Replace boost::optional with std::optional part 2 --- src/server/game/Spells/SpellEffects.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/server/game/Spells/SpellEffects.cpp') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8ddd4574525..0008fedf2d0 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3937,7 +3937,7 @@ void Spell::EffectCharge() Optional spellEffectExtraData; if (effectInfo->MiscValueB) { - spellEffectExtraData = boost::in_place(); + spellEffectExtraData.emplace(); spellEffectExtraData->Target = unitTarget->GetGUID(); spellEffectExtraData->SpellVisualId = effectInfo->MiscValueB; } @@ -3949,7 +3949,7 @@ void Spell::EffectCharge() if (G3D::fuzzyGt(m_spellInfo->Speed, 0.0f) && m_spellInfo->HasAttribute(SPELL_ATTR9_SPECIAL_DELAY_CALCULATION)) speed = pos.GetExactDist(m_caster) / speed; - unitCaster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed, EVENT_CHARGE, false, unitTarget, spellEffectExtraData.get_ptr()); + unitCaster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed, EVENT_CHARGE, false, unitTarget, spellEffectExtraData ? &*spellEffectExtraData : nullptr); } else { @@ -3959,7 +3959,7 @@ void Spell::EffectCharge() speed = Position(pos.x, pos.y, pos.z).GetExactDist(m_caster) / speed; } - unitCaster->GetMotionMaster()->MoveCharge(*m_preGeneratedPath, speed, unitTarget, spellEffectExtraData.get_ptr()); + unitCaster->GetMotionMaster()->MoveCharge(*m_preGeneratedPath, speed, unitTarget, spellEffectExtraData ? &*spellEffectExtraData : nullptr); } } @@ -5784,7 +5784,9 @@ void Spell::EffectJumpCharge() effectExtra->ParabolicCurveId = *params->ParabolicCurveId; } - unitCaster->GetMotionMaster()->MoveJumpWithGravity(*destTarget, speed, params->JumpGravity, EVENT_JUMP, false, arrivalCast.get_ptr(), effectExtra.get_ptr()); + unitCaster->GetMotionMaster()->MoveJumpWithGravity(*destTarget, speed, params->JumpGravity, EVENT_JUMP, false, + arrivalCast ? &*arrivalCast : nullptr, + effectExtra ? &*effectExtra : nullptr); } void Spell::EffectLearnTransmogSet() -- cgit v1.2.3