diff options
Diffstat (limited to 'src/server/game')
-rw-r--r-- | src/server/game/Chat/ChatCommands/ChatCommand.h | 12 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 1 | ||||
-rw-r--r-- | src/server/game/Maps/Map.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 22 |
6 files changed, 21 insertions, 22 deletions
diff --git a/src/server/game/Chat/ChatCommands/ChatCommand.h b/src/server/game/Chat/ChatCommands/ChatCommand.h index fdcf38745ad..840915b4d2f 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommand.h +++ b/src/server/game/Chat/ChatCommands/ChatCommand.h @@ -121,11 +121,11 @@ struct CommandArgsConsumerMulti<Tuple, Optional<NestedNextType>, offset> // try with the argument auto& myArg = std::get<offset>(tuple); myArg.emplace(); - if (char const* next = CommandArgsConsumerSingle<NestedNextType>::TryConsumeTo(*(myArg.get_ptr()), args)) + if (char const* next = CommandArgsConsumerSingle<NestedNextType>::TryConsumeTo(myArg.value(), args)) if ((next = CommandArgsConsumerNext<Tuple, offset+1>::GoNext(tuple, next))) return next; // try again omitting the argument - myArg = boost::none; + myArg = std::nullopt; if (char const* next = CommandArgsConsumerNext<Tuple, offset+1>::GoNext(tuple, args)) return next; return nullptr; @@ -160,8 +160,8 @@ class TC_GAME_API CommandArgs { Optional<std::tuple<advstd::remove_cvref_t<T1>, advstd::remove_cvref_t<T2>, advstd::remove_cvref_t<Ts>...>> rv; rv.emplace(); - if (!TryConsumeToTuple<0>(*(rv.get_ptr()))) - rv = boost::none; + if (!TryConsumeToTuple<0>(rv.value())) + rv = std::nullopt; return rv; } @@ -171,10 +171,10 @@ class TC_GAME_API CommandArgs using T = advstd::remove_cvref_t<T1>; Optional<T> rv; rv.emplace(); - if (char const* next = CommandArgsConsumerSingle<T>::TryConsumeTo(*(rv.get_ptr()), _args)) + if (char const* next = CommandArgsConsumerSingle<T>::TryConsumeTo(rv.value(), _args)) _args = next; else - rv = boost::none; + rv = std::nullopt; return rv; } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 16bf0455951..a929edde806 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -498,7 +498,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation void setActive(bool isActiveObject); bool IsFarVisible() const { return m_isFarVisible; } void SetFarVisible(bool on); - bool IsVisibilityOverridden() const { return m_visibilityDistanceOverride.is_initialized(); } + bool IsVisibilityOverridden() const { return m_visibilityDistanceOverride.has_value(); } void SetVisibilityDistanceOverride(VisibilityDistanceType type); void SetWorldObject(bool apply); bool IsPermanentWorldObject() const { return m_isWorldObject; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 47bf4e2766a..43999fadf10 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -20,7 +20,6 @@ #include "Object.h" #include "CombatManager.h" -#include "OptionalFwd.h" #include "SpellAuraDefines.h" #include "ThreatManager.h" #include "Timer.h" diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 3b5d31af057..a5dd811e255 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2759,7 +2759,7 @@ void Map::GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, fl { if (wmoData->areaInfo) { - data.areaInfo = boost::in_place(wmoData->areaInfo->adtId, wmoData->areaInfo->rootId, wmoData->areaInfo->groupId, wmoData->areaInfo->mogpFlags); + data.areaInfo.emplace(wmoData->areaInfo->adtId, wmoData->areaInfo->rootId, wmoData->areaInfo->groupId, wmoData->areaInfo->mogpFlags); // wmo found WMOAreaTableEntry const* wmoEntry = GetWMOAreaTableEntryByTripple(wmoData->areaInfo->rootId, wmoData->areaInfo->adtId, wmoData->areaInfo->groupId); data.outdoors = (wmoData->areaInfo->mogpFlags & 0x8) != 0; @@ -2820,7 +2820,7 @@ void Map::GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, fl } } - data.liquidInfo = boost::in_place(); + data.liquidInfo.emplace(); data.liquidInfo->level = wmoData->liquidInfo->level; data.liquidInfo->depth_level = wmoData->floorZ; data.liquidInfo->entry = liquidType; diff --git a/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp index b3e9e56c81e..e6e68190d80 100644 --- a/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp @@ -151,7 +151,7 @@ bool ChaseMovementGenerator::Update(Unit* owner, uint32 diff) } // if the target moved, we have to consider whether to adjust - if (!_lastTargetPosition || target->GetPosition() != _lastTargetPosition.get() || mutualChase != _mutualChase) + if (!_lastTargetPosition || target->GetPosition() != _lastTargetPosition.value() || mutualChase != _mutualChase) { _lastTargetPosition = target->GetPosition(); _mutualChase = mutualChase; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index bf749102080..69f365785df 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -185,14 +185,14 @@ void SpellCastTargets::Write(WorldPackets::Spells::SpellTargetData& data) if (m_targetMask & (TARGET_FLAG_ITEM | TARGET_FLAG_TRADE_ITEM)) { - data.Item = boost::in_place(); + data.Item.emplace(); if (m_itemTarget) data.Item = m_itemTarget->GetGUID(); } if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - data.SrcLocation = boost::in_place(); + data.SrcLocation.emplace(); data.SrcLocation->Transport = m_src._transportGUID; if (!m_src._transportGUID.IsEmpty()) data.SrcLocation->Location = m_src._transportOffset; @@ -202,7 +202,7 @@ void SpellCastTargets::Write(WorldPackets::Spells::SpellTargetData& data) if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - data.DstLocation = boost::in_place(); + data.DstLocation.emplace(); data.DstLocation->Transport = m_dst._transportGUID; if (m_dst._transportGUID) data.DstLocation->Location = m_dst._transportOffset; @@ -4214,13 +4214,13 @@ void Spell::SendSpellStart() if (castFlags & CAST_FLAG_AMMO) { - castData.Ammo = boost::in_place(); + castData.Ammo.emplace(); UpdateSpellCastDataAmmo(*castData.Ammo); } if (castFlags & CAST_FLAG_IMMUNITY) { - castData.Immunities = boost::in_place(); + castData.Immunities.emplace(); castData.Immunities->School = schoolImmunityMask; castData.Immunities->Value = mechanicImmunityMask; } @@ -4290,7 +4290,7 @@ void Spell::SendSpellGo() if (castFlags & CAST_FLAG_RUNE_LIST && !m_spellInfo->HasAura(SPELL_AURA_CONVERT_RUNE)) // rune cooldowns list { - castData.RemainingRunes = boost::in_place(); + castData.RemainingRunes.emplace(); /// @todo There is a crash caused by a spell with CAST_FLAG_RUNE_LIST cast by a creature // The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster @@ -4316,14 +4316,14 @@ void Spell::SendSpellGo() if (castFlags & CAST_FLAG_ADJUST_MISSILE) { - castData.MissileTrajectory = boost::in_place(); + castData.MissileTrajectory.emplace(); castData.MissileTrajectory->Pitch = m_targets.GetElevation(); castData.MissileTrajectory->TravelTime = m_delayMoment; } if (castFlags & CAST_FLAG_AMMO) { - castData.Ammo = boost::in_place(); + castData.Ammo.emplace(); UpdateSpellCastDataAmmo(*castData.Ammo); } @@ -4337,7 +4337,7 @@ void Spell::SendSpellGo() // update nearby players (remove flag) castData.CastFlags &= ~CAST_FLAG_POWER_LEFT_SELF; - castData.RemainingPower = boost::none; + castData.RemainingPower = std::nullopt; m_caster->SendMessageToSet(packet.Write(), false); } else @@ -4431,8 +4431,8 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo) /// Writes miss and hit targets for a SMSG_SPELL_GO packet void Spell::UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData& data) { - data.HitTargets = boost::in_place(); - data.MissStatus = boost::in_place(); + data.HitTargets.emplace(); + data.MissStatus.emplace(); // This function also fill data for channeled spells: // m_needAliveTargetMask req for stop channelig if one target die |