Core/Misc: Use boost::in_place() to initialize optionals.

* Improves commit 800d5d8939
* Thanks @Shauren for this great suggestion.
This commit is contained in:
Naios
2015-04-27 17:01:30 +02:00
parent 5acc4b14aa
commit d37ecf796e
15 changed files with 28 additions and 27 deletions

View File

@@ -1135,7 +1135,7 @@ void WorldSession::SendFeatureSystemStatus()
features.VoiceEnabled = false;
features.BrowserEnabled = false; // Has to be false, otherwise client will crash if "Customer Support" is opened
features.EuropaTicketSystemStatus = WorldPackets::System::FeatureSystemStatus::EuropaTicketConfig();
features.EuropaTicketSystemStatus = boost::in_place();
features.EuropaTicketSystemStatus->ThrottleState.MaxTries = 10;
features.EuropaTicketSystemStatus->ThrottleState.PerMilliseconds = 60000;
features.EuropaTicketSystemStatus->ThrottleState.TryCount = 1;
@@ -2583,7 +2583,7 @@ void WorldSession::SendCharFactionChange(ResponseCodes result, WorldPackets::Cha
if (result == RESPONSE_SUCCESS)
{
packet.Display = WorldPackets::Character::CharFactionChangeResult::CharFactionChangeDisplayInfo();
packet.Display = boost::in_place();
packet.Display->Name = factionChangeInfo->Name;
packet.Display->SexID = factionChangeInfo->SexID;
packet.Display->SkinID = *factionChangeInfo->SkinID;