Core/Scripts: pass message parameter by reference in OnChat methods to make it possible to be modified inside the script.
--HG-- branch : trunk
This commit is contained in:
@@ -629,14 +629,14 @@ public:
|
||||
if (count < 3)
|
||||
{
|
||||
if (plr)
|
||||
plr->Say(Text[count],0);
|
||||
plr->Say(std::string(Text[count]),0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoCast(me, SPELL_RHYME_BIG);
|
||||
if (plr)
|
||||
{
|
||||
plr->Say(Text[count],0);
|
||||
plr->Say(std::string(Text[count]),0);
|
||||
plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
|
||||
}
|
||||
wp_reached = true;
|
||||
|
||||
@@ -24,7 +24,7 @@ class ChatLogScript : public PlayerScript
|
||||
public:
|
||||
ChatLogScript() : PlayerScript("ChatLogScript") { }
|
||||
|
||||
void OnChat(Player* player, uint32 type, uint32 lang, std::string msg)
|
||||
void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -54,14 +54,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string msg, Player *receiver)
|
||||
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Player *receiver)
|
||||
{
|
||||
if (sWorld.getBoolConfig(CONFIG_CHATLOG_WHISPER))
|
||||
sLog.outChat("[WHISPER] Player %s tells %s: %s",
|
||||
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg.c_str());
|
||||
}
|
||||
|
||||
void OnChat(Player *player, uint32 type, uint32 /*lang*/, std::string msg, Group *group)
|
||||
void OnChat(Player *player, uint32 type, uint32 /*lang*/, std::string& msg, Group *group)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OnChat(Player *player, uint32 type, uint32 lang, std::string msg, Guild *guild)
|
||||
void OnChat(Player *player, uint32 type, uint32 lang, std::string& msg, Guild *guild)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string msg, Channel *channel)
|
||||
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Channel *channel)
|
||||
{
|
||||
bool isSystem = channel &&
|
||||
(channel->HasFlag(CHANNEL_FLAG_TRADE) ||
|
||||
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
else
|
||||
{
|
||||
//This should be sent to the player as red text.
|
||||
pPlayer->Say("You have created enough ghouls. Return to Gothik the Harvester at Death's Breach.",LANG_UNIVERSAL);
|
||||
pPlayer->Say(std::string("You have created enough ghouls. Return to Gothik the Harvester at Death's Breach."), LANG_UNIVERSAL);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user