diff options
author | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
---|---|---|
committer | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
commit | 3142598dee31acc23c738a1a728638665c8940b8 (patch) | |
tree | 2eb837ed785678d536d677ff5020fabca089f2e5 /src/CompositeChat.cpp | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge pull request #2182 from birkett/master (diff) | |
download | cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.gz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.bz2 cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.lz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.xz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.zst cuberite-3142598dee31acc23c738a1a728638665c8940b8.zip |
Diffstat (limited to 'src/CompositeChat.cpp')
-rw-r--r-- | src/CompositeChat.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp index d1eb0b852..5d6c028ab 100644 --- a/src/CompositeChat.cpp +++ b/src/CompositeChat.cpp @@ -342,7 +342,11 @@ AString cCompositeChat::ExtractText(void) const } case ptUrl: { - Msg.append(((cUrlPart *)(*itr))->m_Url); + Msg.append((static_cast<cUrlPart *>(*itr))->m_Url); + break; + } + case ptShowAchievement: + { break; } } // switch (PartType) @@ -419,7 +423,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const case cCompositeChat::ptClientTranslated: { - const cCompositeChat::cClientTranslatedPart & p = (const cCompositeChat::cClientTranslatedPart &)**itr; + const cCompositeChat::cClientTranslatedPart & p = static_cast<const cCompositeChat::cClientTranslatedPart &>(**itr); Part["translate"] = p.m_Text; Json::Value With; for (AStringVector::const_iterator itrW = p.m_Parameters.begin(), endW = p.m_Parameters.end(); itrW != endW; ++itr) @@ -436,7 +440,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const case cCompositeChat::ptUrl: { - const cCompositeChat::cUrlPart & p = (const cCompositeChat::cUrlPart &)**itr; + const cCompositeChat::cUrlPart & p = static_cast<const cCompositeChat::cUrlPart &>(**itr); Part["text"] = p.m_Text; Json::Value Url; Url["action"] = "open_url"; @@ -449,7 +453,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const case cCompositeChat::ptSuggestCommand: case cCompositeChat::ptRunCommand: { - const cCompositeChat::cCommandPart & p = (const cCompositeChat::cCommandPart &)**itr; + const cCompositeChat::cCommandPart & p = static_cast<const cCompositeChat::cCommandPart &>(**itr); Part["text"] = p.m_Text; Json::Value Cmd; Cmd["action"] = (p.m_PartType == cCompositeChat::ptRunCommand) ? "run_command" : "suggest_command"; @@ -461,7 +465,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const case cCompositeChat::ptShowAchievement: { - const cCompositeChat::cShowAchievementPart & p = (const cCompositeChat::cShowAchievementPart &)**itr; + const cCompositeChat::cShowAchievementPart & p = static_cast<const cCompositeChat::cShowAchievementPart &>(**itr); Part["translate"] = "chat.type.achievement"; Json::Value Ach; |