summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp16
-rw-r--r--src/gui/windows/skilldialog.cpp8
2 files changed, 13 insertions, 11 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index e29212063..25c85638a 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -702,13 +702,15 @@ void ChatWindow::doPresent() const
}
}
- const std::string log = strprintf(
- // TRANSLATORS: chat message
- _("Present: %s; %d players are present."),
- response.c_str(), playercount);
-
- if (getFocused() != nullptr)
- getFocused()->chatLog(log, ChatMsgType::BY_SERVER);
+ ChatTab *const tab = getFocused();
+ if (tab != nullptr)
+ {
+ const std::string log = strprintf(
+ // TRANSLATORS: chat message
+ _("Present: %s; %d players are present."),
+ response.c_str(), playercount);
+ tab->chatLog(log, ChatMsgType::BY_SERVER);
+ }
}
void ChatWindow::scroll(const int amount) const
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index b5a49b0ca..20d95a055 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -474,13 +474,13 @@ SkillInfo *SkillDialog::loadSkill(XmlNodeConstPtr node,
id += SKILL_VAR_MIN_ID;
}
- std::string name = XML::langProperty(node, "name",
- // TRANSLATORS: skills dialog. skill id
- strprintf(_("Skill %d"), id));
-
SkillInfo *skill = getSkill(id);
if (skill == nullptr)
{
+ std::string name = XML::langProperty(node, "name",
+ // TRANSLATORS: skills dialog. skill id
+ strprintf(_("Skill %d"), id));
+
skill = new SkillInfo;
skill->id = CAST_U32(id);
skill->modifiable = Modifiable_false;