diff options
| author | azazel <none@none> | 2010-11-17 18:14:35 +0600 |
|---|---|---|
| committer | azazel <none@none> | 2010-11-17 18:14:35 +0600 |
| commit | 4fb572015ac9f250e00d9894361226c31b7ec5cf (patch) | |
| tree | 99102d01b260e3b0af813dee12874936ef29601a /src/server/scripts/World | |
| parent | 169c2ef87ac09f26dafb665f3fd6abd74b7fda47 (diff) | |
Core/Scripts: pass message parameter by reference in OnChat methods to make it possible to be modified inside the script.
--HG--
branch : trunk
Diffstat (limited to 'src/server/scripts/World')
| -rwxr-xr-x | src/server/scripts/World/chat_log.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/World/item_scripts.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp index 656399d46d8..a440f2d51c6 100755 --- a/src/server/scripts/World/chat_log.cpp +++ b/src/server/scripts/World/chat_log.cpp @@ -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) || diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 1bca886d5f3..9f0b5cbf6c0 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -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; } } |
