summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-05-29 11:08:32 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-05-29 11:08:32 +0200
commit1e6f02437e88495d57249f742526526ee5865777 (patch)
treeaf200ec3c23c5d04359ba471d275cfa6d0a3c7fb /src/CompositeChat.cpp
parentMerge pull request #2157 from beeduck/Issue2106 (diff)
parentMerge branch 'master' into PreventNewWarnings (diff)
downloadcuberite-1e6f02437e88495d57249f742526526ee5865777.tar
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.gz
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.bz2
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.lz
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.xz
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.zst
cuberite-1e6f02437e88495d57249f742526526ee5865777.zip
Diffstat (limited to 'src/CompositeChat.cpp')
-rw-r--r--src/CompositeChat.cpp14
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;