aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Formulas.h2
-rw-r--r--src/game/Level2.cpp8
-rw-r--r--src/shared/Util.cpp6
-rw-r--r--src/shared/revision_nr.h2
4 files changed, 8 insertions, 10 deletions
diff --git a/src/game/Formulas.h b/src/game/Formulas.h
index dc90b21e535..041c0621c74 100644
--- a/src/game/Formulas.h
+++ b/src/game/Formulas.h
@@ -34,7 +34,7 @@ namespace Trinity
}
namespace XP
{
- typedef enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
+ enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
inline uint32 GetGrayLevel(uint32 pl_level)
{
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 05af6cbcbfe..21f196c74e2 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1915,18 +1915,14 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
return false;
}
- char* FactionName;
for(FactionStateList::const_iterator itr = target->m_factions.begin(); itr != target->m_factions.end(); ++itr)
{
FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID);
- if (factionEntry)
- FactionName = factionEntry->name[m_session->GetSessionDbcLocale()];
- else
- FactionName = "#Not found#";
+ char const* factionName = factionEntry ? factionEntry->name[m_session->GetSessionDbcLocale()] : "#Not found#";
ReputationRank rank = target->GetReputationRank(factionEntry);
std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
- ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << FactionName << "]|h|r " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
+ ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << factionName << "]|h|r " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
if(itr->second.Flags & FACTION_FLAG_VISIBLE)
ss << GetTrinityString(LANG_FACTION_VISIBLE);
diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp
index 36c41e5da48..767b65e441c 100644
--- a/src/shared/Util.cpp
+++ b/src/shared/Util.cpp
@@ -254,8 +254,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
size_t len = utf8::distance(utf8str,utf8str+csize);
if(len > wsize)
{
+ if(wsize > 0)
+ wstr[0] = L'\0';
wsize = 0;
- wstr = L"";
return false;
}
@@ -265,8 +266,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
}
catch(std::exception)
{
+ if(wsize > 0)
+ wstr[0] = L'\0';
wsize = 0;
- wstr = L"";
return false;
}
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index caca4e0642d..6e70795b567 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7295"
+ #define REVISION_NR "7296"
#endif // __REVISION_NR_H__