Skip to content

Commit

Permalink
fix crash when chatting on moderated channel #68
Browse files Browse the repository at this point in the history
  • Loading branch information
HarpyWar committed Jul 24, 2014
1 parent e6e0785 commit 60ea380
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bnetd/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ namespace pvpgn
if (!((account_is_operator_or_admin(acc, channel_get_name(channel))) ||
(channel_conn_has_tmpVOICE(channel, me)) || (account_get_auth_voice(acc, channel_get_name(channel)) == 1)))
{
message_send_text(me, message_type_error, me, localize(c, "This channel is moderated"));
message_send_text(me, message_type_error, me, localize(me, "This channel is moderated"));
return;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/bnetd/i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,16 @@ namespace pvpgn

extern std::string _localize(t_connection * c, const char * func, const char * fmt, const fmt::ArgList &args)
{
const char *format;
const char *format = fmt;
std::string output(fmt);
t_gamelang lang;

if (!c) {
eventlog(eventlog_level_error, __FUNCTION__, "got bad connection");
return format;
}
try
{
format = fmt;

if (lang = conn_get_gamelang_localized(c))
if (!(format = _find_string(fmt, lang)))
format = fmt; // if not found use original
Expand Down

0 comments on commit 60ea380

Please sign in to comment.