From 2bde0b40bb417fafbbb39a1055e268f9cb075822 Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Mon, 30 Sep 2013 22:17:34 -0400 Subject: [PATCH] Fixed issue with #showstats window, should probably be refactored to completely use stringstream or to_string whenever VS2010 support is dropped --- changelog.txt | 1 + zone/client.cpp | 49 ++++++++++++++++++++++++++----------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/changelog.txt b/changelog.txt index fa0fdb2aa..9f471fd00 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 09/30/2013 == Sorvani: Changed SummonItem to only summon an item with max charges when said default value is present and not on zero charges +demonstar55: Fixed issue with #showstats showing your level for a bunch of values == 09/13/2013 == demonstar55: Add support for /pet hold on and /pet hold off (UF and RoF) diff --git a/zone/client.cpp b/zone/client.cpp index 572954974..699bd3136 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -18,6 +18,7 @@ #include "../common/debug.h" #include #include +#include #include #include #include @@ -6620,34 +6621,36 @@ void Client::SendStatsWindow(Client* client, bool use_window) indP + "Wind: " + itoa(GetWindMod()) + "
"; } - std::string final_stats = "" + - /* C/L/R */ indP + "Class: " + class_Name + indS + "Level: " + itoa(GetLevel()) + indS + "Race: " + race_Name + "
" + - /* Runes */ indP + "Rune: " + itoa(rune_number) + indL + indS + "Spell Rune: " + itoa(magic_rune_number) + "
" + - /* HP/M/E */ HME_row + - /* DS */ indP + "DS: " + itoa(itembonuses.DamageShield + spellbonuses.DamageShield*-1) + " (Spell: " + itoa(spellbonuses.DamageShield*-1) + " + Item: " + itoa(itembonuses.DamageShield) + " / " + itoa(RuleI(Character, ItemDamageShieldCap)) + ")
" + - /* Atk */ indP + "ATK: " + itoa(GetTotalATK()) + "
" + - /* Atk2 */ indP + "- Base: " + itoa(GetATKRating()) + " | Item: " + itoa(itembonuses.ATK) + " (" + itoa(RuleI(Character, ItemATKCap)) + ")~Used: " + itoa((itembonuses.ATK * 1.342)) + " | Spell: " + itoa(spellbonuses.ATK) + "
" + - /* AC */ indP + "AC: " + itoa(CalcAC()) + "
" + - /* AC2 */ indP + "- Mit: " + itoa(GetACMit()) + " | Avoid: " + itoa(GetACAvoid()) + " | Spell: " + itoa(spellbonuses.AC) + " | Shield: " + itoa(shield_ac) + "
" + - /* Haste */ indP + "Haste: " + itoa(GetHaste()) + "
" + - /* Haste2 */ indP + " - Item: " + itoa(itembonuses.haste) + " + Spell: " + itoa(spellbonuses.haste + spellbonuses.hastetype2) + " (Cap: " + itoa(RuleI(Character, HasteCap)) + ") | Over: " + itoa(spellbonuses.hastetype3 + ExtraHaste) + "

" + - /* RegenLbl */ indL + indS + "Regen
" + indS + indP + indP + " Base | Items (Cap) " + indP + " | Spell | A.A.s | Total
" + - /* Regen */ regen_string + "
" + - /* Stats */ stat_field + "

" + - /* Mod2s */ mod2_field + "
" + - /* HealAmt */ indP + "Heal Amount: " + itoa(GetHealAmt()) + " / " + itoa(RuleI(Character, ItemHealAmtCap)) + "
" + - /* SpellDmg*/ indP + "Spell Dmg: " + itoa(GetSpellDmg()) + " / " + itoa(RuleI(Character, ItemSpellDmgCap)) + "
" + - /* Clair */ indP + "Clairvoyance: " + itoa(GetClair()) + " / " + itoa(RuleI(Character, ItemClairvoyanceCap)) + "
" + - /* DSMit */ indP + "Dmg Shld Mit: " + itoa(GetDSMit()) + " / " + itoa(RuleI(Character, ItemDSMitigationCap)) + "

"; + std::ostringstream final_string; + final_string << + /* C/L/R */ indP << "Class: " << class_Name << indS << "Level: " << static_cast(GetLevel()) << indS << "Race: " << race_Name << "
" << + /* Runes */ indP << "Rune: " << rune_number << indL << indS << "Spell Rune: " << magic_rune_number << "
" << + /* HP/M/E */ HME_row << + /* DS */ indP << "DS: " << (itembonuses.DamageShield + spellbonuses.DamageShield*-1) << " (Spell: " << (spellbonuses.DamageShield*-1) << " + Item: " << itembonuses.DamageShield << " / " << RuleI(Character, ItemDamageShieldCap) << ")
" << + /* Atk */ indP << "ATK: " << GetTotalATK() << "
" << + /* Atk2 */ indP << "- Base: " << GetATKRating() << " | Item: " << itembonuses.ATK << " (" << RuleI(Character, ItemATKCap) << ")~Used: " << (itembonuses.ATK * 1.342) << " | Spell: " << spellbonuses.ATK << "
" << + /* AC */ indP << "AC: " << CalcAC() << "
" << + /* AC2 */ indP << "- Mit: " << GetACMit() << " | Avoid: " << GetACAvoid() << " | Spell: " << spellbonuses.AC << " | Shield: " << shield_ac << "
" << + /* Haste */ indP << "Haste: " << GetHaste() << "
" << + /* Haste2 */ indP << " - Item: " << itembonuses.haste << " + Spell: " << (spellbonuses.haste + spellbonuses.hastetype2) << " (Cap: " << RuleI(Character, HasteCap) << ") | Over: " << (spellbonuses.hastetype3 + ExtraHaste) << "

" << + /* RegenLbl */ indL << indS << "Regen
" << indS << indP << indP << " Base | Items (Cap) " << indP << " | Spell | A.A.s | Total
" << + /* Regen */ regen_string << "
" << + /* Stats */ stat_field << "

" << + /* Mod2s */ mod2_field << "
" << + /* HealAmt */ indP << "Heal Amount: " << GetHealAmt() << " / " << RuleI(Character, ItemHealAmtCap) << "
" << + /* SpellDmg*/ indP << "Spell Dmg: " << GetSpellDmg() << " / " << RuleI(Character, ItemSpellDmgCap) << "
" << + /* Clair */ indP << "Clairvoyance: " << GetClair() << " / " << RuleI(Character, ItemClairvoyanceCap) << "
" << + /* DSMit */ indP << "Dmg Shld Mit: " << GetDSMit() << " / " << RuleI(Character, ItemDSMitigationCap) << "

"; if(GetClass() == BARD) - final_stats += bard_info + "
"; + final_string << bard_info << "
"; if(skill_mods.size() > 0) - final_stats += skill_mods + "
"; + final_string << skill_mods << "
"; if(skill_dmgs.size() > 0) - final_stats += skill_dmgs + "
"; + final_string << skill_dmgs << "
"; if(faction_item_string.size() > 0) - final_stats += faction_item_string; + final_string << faction_item_string; + std::string final_stats = final_string.str(); if(use_window) { if(final_stats.size() < 4096)