aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/Commands
diff options
context:
space:
mode:
authorSpp- <u84280@epreinf21.(none)>2011-07-29 14:18:28 +0200
committerSpp- <u84280@epreinf21.(none)>2011-07-29 14:18:28 +0200
commite47b96af3e3a41eae71e3e3da7eeee8bd3de86bc (patch)
tree07d5ff1e6e39d792dbe1a89cc373c06702817787 /src/server/game/Chat/Commands
parent06b46ba203d30cc5e2abc9741b2fc737ebdd7c38 (diff)
Core: Append single character to stream as character, not as a string
Diffstat (limited to 'src/server/game/Chat/Commands')
-rwxr-xr-xsrc/server/game/Chat/Commands/Level1.cpp6
-rwxr-xr-xsrc/server/game/Chat/Commands/Level2.cpp21
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp16
3 files changed, 22 insertions, 21 deletions
diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp
index 6936f3ef07e..74300e5d02f 100755
--- a/src/server/game/Chat/Commands/Level1.cpp
+++ b/src/server/game/Chat/Commands/Level1.cpp
@@ -512,9 +512,9 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
// send area in "id - [name]" format
std::ostringstream ss;
if (m_session)
- ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << " " << localeNames[loc]<< "]|h|r";
+ ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[loc]<< "]|h|r";
else
- ss << areaEntry->ID << " - " << name << " " << localeNames[loc];
+ ss << areaEntry->ID << " - " << name << ' ' << localeNames[loc];
SendSysMessage (ss.str ().c_str());
@@ -575,7 +575,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
if (m_session)
reply << " |cffffffff|Htele:" << itr->first << "|h[" << tele->name << "]|h|r\n";
else
- reply << " " << itr->first << " " << tele->name << "\n";
+ reply << " " << itr->first << ' ' << tele->name << "\n";
}
if (reply.str().empty())
diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
index 7362353b3cf..3c8c4325e72 100755
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ b/src/server/game/Chat/Commands/Level2.cpp
@@ -506,29 +506,30 @@ bool ChatHandler::HandleCharacterReputationCommand(const char* args)
FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
{
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID);
+ const FactionState& faction = itr->second;
+ FactionEntry const *factionEntry = sFactionStore.LookupEntry(faction.ID);
char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
if (m_session)
- ss << itr->second.ID << " - |cffffffff|Hfaction:" << itr->second.ID << "|h[" << factionName << " " << localeNames[loc] << "]|h|r";
+ ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r";
else
- ss << itr->second.ID << " - " << factionName << " " << localeNames[loc];
+ ss << faction.ID << " - " << factionName << ' ' << localeNames[loc];
- ss << " " << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ")";
+ ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
- if (itr->second.Flags & FACTION_FLAG_VISIBLE)
+ if (faction.Flags & FACTION_FLAG_VISIBLE)
ss << GetTrinityString(LANG_FACTION_VISIBLE);
- if (itr->second.Flags & FACTION_FLAG_AT_WAR)
+ if (faction.Flags & FACTION_FLAG_AT_WAR)
ss << GetTrinityString(LANG_FACTION_ATWAR);
- if (itr->second.Flags & FACTION_FLAG_PEACE_FORCED)
+ if (faction.Flags & FACTION_FLAG_PEACE_FORCED)
ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if (itr->second.Flags & FACTION_FLAG_HIDDEN)
+ if (faction.Flags & FACTION_FLAG_HIDDEN)
ss << GetTrinityString(LANG_FACTION_HIDDEN);
- if (itr->second.Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED)
ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if (itr->second.Flags & FACTION_FLAG_INACTIVE)
+ if (faction.Flags & FACTION_FLAG_INACTIVE)
ss << GetTrinityString(LANG_FACTION_INACTIVE);
SendSysMessage(ss.str().c_str());
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index dfe5e3edd7c..eb53d856385 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -1062,9 +1062,9 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args)
ss << GetTrinityString(LANG_SPELL_RANK) << rank;
if (m_session)
- ss << " " << localeNames[loc] << "]|h|r";
+ ss << ' ' << localeNames[loc] << "]|h|r";
else
- ss << " " << localeNames[loc];
+ ss << ' ' << localeNames[loc];
if (talent)
ss << GetTrinityString(LANG_TALENT);
@@ -1426,16 +1426,16 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args)
// or "id - [faction] [no reputation]" format
std::ostringstream ss;
if (m_session)
- ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r";
+ ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[loc] << "]|h|r";
else
- ss << id << " - " << name << " " << localeNames[loc];
+ ss << id << " - " << name << ' ' << localeNames[loc];
if (repState) // and then target != NULL also
{
uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
std::string rankName = GetTrinityString(index);
- ss << " " << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ")";
+ ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
if (repState->Flags & FACTION_FLAG_VISIBLE)
ss << GetTrinityString(LANG_FACTION_VISIBLE);
@@ -1589,9 +1589,9 @@ bool ChatHandler::HandleLookupMapCommand(const char *args)
std::ostringstream ss;
if (m_session)
- ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << "]";
+ ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << ']';
else // console
- ss << id << " - [" << name << "]";
+ ss << id << " - [" << name << ']';
if (MapInfo->IsContinent())
ss << GetTrinityString(LANG_CONTINENT);
@@ -4029,7 +4029,7 @@ std::string GetTimeString(uint64 time)
std::ostringstream ss;
if (days) ss << days << "d ";
if (hours) ss << hours << "h ";
- ss << minute << "m";
+ ss << minute << 'm';
return ss.str();
}