diff options
author | Naios <naios-dev@live.de> | 2015-04-27 17:01:30 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2015-04-27 17:01:30 +0200 |
commit | d37ecf796ef24fe96e56ef5262bab1ae4390dc2f (patch) | |
tree | 41c3f6d6493175a595af3bf387403763c1345cd2 /src/server/game/Spells/Spell.cpp | |
parent | 5acc4b14aa81a5e9a946d11cfa9034d334ea7144 (diff) |
Core/Misc: Use boost::in_place() to initialize optionals.
* Improves commit 800d5d893964a822655
* Thanks @Shauren for this great suggestion.
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2fd118941b6..194467ccadf 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -222,7 +222,7 @@ void SpellCastTargets::Write(WorldPackets::Spells::SpellTargetData& data) if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - data.SrcLocation = WorldPackets::Spells::TargetLocation(); + data.SrcLocation = boost::in_place(); data.SrcLocation->Transport = m_src._transportGUID; // relative position guid here - transport for example if (!m_src._transportGUID.IsEmpty()) data.SrcLocation->Location = m_src._transportOffset; @@ -232,7 +232,7 @@ void SpellCastTargets::Write(WorldPackets::Spells::SpellTargetData& data) if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - data.DstLocation = WorldPackets::Spells::TargetLocation(); + data.DstLocation = boost::in_place(); data.DstLocation->Transport = m_dst._transportGUID; // relative position guid here - transport for example if (!m_dst._transportGUID.IsEmpty()) data.DstLocation->Location = m_dst._transportOffset; @@ -3888,7 +3888,7 @@ void Spell::SendSpellStart() if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list { - castData.RemainingRunes = WorldPackets::Spells::RuneData(); + castData.RemainingRunes = boost::in_place(); //TODO: There is a crash caused by a spell with CAST_FLAG_RUNE_LIST casted by a creature //The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster @@ -4006,7 +4006,7 @@ void Spell::SendSpellGo() if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list { - castData.RemainingRunes = WorldPackets::Spells::RuneData(); + castData.RemainingRunes = boost::in_place(); //TODO: There is a crash caused by a spell with CAST_FLAG_RUNE_LIST casted by a creature //The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster |