From 84c7eb5643c0290b3702e7f0687270e047b40529 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jan 2012 21:14:57 +0100 Subject: Core/Scripts: Fixed DoSendNotifyToInstance message formatting (that should only be done once) --- src/server/game/Instances/InstanceScript.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index fa8c0fb39e4..76a812bffcb 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -302,21 +302,21 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) } // Send Notify to all players in instance -void InstanceScript::DoSendNotifyToInstance(const char *format, ...) +void InstanceScript::DoSendNotifyToInstance(char* const format, ...) { - InstanceMap::PlayerList const &PlayerList = instance->GetPlayers(); + InstanceMap::PlayerList const& players = instance->GetPlayers(); - if (!PlayerList.isEmpty()) + if (!players.isEmpty()) { va_list ap; va_start(ap, format); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* player = i->getSource()) - if (WorldSession* pSession = player->GetSession()) - pSession->SendNotification(format, ap); - } + char buff[1024]; + vsnprintf(buff, 1024, format, ap); va_end(ap); + for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) + if (Player* player = i->getSource()) + if (WorldSession* session = player->GetSession()) + session->SendNotification(buff); } } -- cgit v1.2.3