aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Instances/InstanceScript.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-01-12 21:14:57 +0100
committerShauren <shauren.trinity@gmail.com>2012-01-12 21:14:57 +0100
commit84c7eb5643c0290b3702e7f0687270e047b40529 (patch)
tree29c72deab9c45642591073ee9a4d1cfa0d554c1c /src/server/game/Instances/InstanceScript.cpp
parentd3f66dfe6d270ccbe1f6197a2f2e52d541926ca0 (diff)
Core/Scripts: Fixed DoSendNotifyToInstance message formatting (that should only be done once)
Diffstat (limited to 'src/server/game/Instances/InstanceScript.cpp')
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp18
1 files changed, 9 insertions, 9 deletions
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);
}
}