mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-03 10:33:52 +00:00
[Bug Fix] Fix Strings::Commify bug with #mystats (#4547)
* Fix a formatting bug with #mystats When using values larger than 1,000, we were calling commify on a string that already had commas. This resulted in the value 1005 looking like 1,,005. * Update mob.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
parent
62ac015fff
commit
b2d0fa6a2f
48
zone/mob.cpp
48
zone/mob.cpp
@ -2048,19 +2048,19 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
|
||||
case 0: {
|
||||
mod2a_name = "Avoidance";
|
||||
mod2b_name = "Combat Effects";
|
||||
mod2a_cap = Strings::Commify(RuleI(Character, ItemAvoidanceCap));
|
||||
mod2b_cap = Strings::Commify(RuleI(Character, ItemCombatEffectsCap));
|
||||
mod2a_cap = RuleI(Character, ItemAvoidanceCap);
|
||||
mod2b_cap = RuleI(Character, ItemCombatEffectsCap);
|
||||
|
||||
if (IsBot()) {
|
||||
mod2a = Strings::Commify(CastToBot()->GetAvoidance());
|
||||
mod2a = CastToBot()->GetAvoidance();
|
||||
} else if (IsClient()) {
|
||||
mod2a = Strings::Commify(CastToClient()->GetAvoidance());
|
||||
mod2a = CastToClient()->GetAvoidance();
|
||||
}
|
||||
|
||||
if (IsBot()) {
|
||||
mod2b = Strings::Commify(CastToBot()->GetCombatEffects());
|
||||
mod2b = CastToBot()->GetCombatEffects();
|
||||
} else if (IsClient()) {
|
||||
mod2b = Strings::Commify(CastToClient()->GetCombatEffects());
|
||||
mod2b = CastToClient()->GetCombatEffects();
|
||||
}
|
||||
|
||||
break;
|
||||
@ -2068,19 +2068,19 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
|
||||
case 1: {
|
||||
mod2a_name = "Accuracy";
|
||||
mod2b_name = "Strikethrough";
|
||||
mod2a_cap = Strings::Commify(RuleI(Character, ItemAccuracyCap));
|
||||
mod2b_cap = Strings::Commify(RuleI(Character, ItemStrikethroughCap));
|
||||
mod2a_cap = RuleI(Character, ItemAccuracyCap);
|
||||
mod2b_cap = RuleI(Character, ItemStrikethroughCap);
|
||||
|
||||
if (IsBot()) {
|
||||
mod2a = Strings::Commify(CastToBot()->GetAccuracy());
|
||||
mod2a = CastToBot()->GetAccuracy();
|
||||
} else if (IsClient()) {
|
||||
mod2a = Strings::Commify(CastToClient()->GetAccuracy());
|
||||
mod2a = CastToClient()->GetAccuracy();
|
||||
}
|
||||
|
||||
if (IsBot()) {
|
||||
mod2b = Strings::Commify(CastToBot()->GetStrikeThrough());
|
||||
mod2b = CastToBot()->GetStrikeThrough();
|
||||
} else if (IsClient()) {
|
||||
mod2b = Strings::Commify(CastToClient()->GetStrikeThrough());
|
||||
mod2b = CastToClient()->GetStrikeThrough();
|
||||
}
|
||||
|
||||
break;
|
||||
@ -2088,20 +2088,20 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
|
||||
case 2: {
|
||||
mod2a_name = "Shielding";
|
||||
mod2b_name = "Spell Shielding";
|
||||
mod2a_cap = Strings::Commify(RuleI(Character, ItemShieldingCap));
|
||||
mod2b_cap = Strings::Commify(RuleI(Character, ItemSpellShieldingCap));
|
||||
mod2a_cap = RuleI(Character, ItemShieldingCap);
|
||||
mod2b_cap = RuleI(Character, ItemSpellShieldingCap);
|
||||
|
||||
if (IsBot()) {
|
||||
mod2a = Strings::Commify(CastToBot()->GetShielding());
|
||||
mod2a = CastToBot()->GetShielding();
|
||||
} else if (IsClient()) {
|
||||
mod2a = Strings::Commify(CastToClient()->GetShielding());
|
||||
mod2a = CastToClient()->GetShielding();
|
||||
}
|
||||
|
||||
|
||||
if (IsBot()) {
|
||||
mod2b = Strings::Commify(CastToBot()->GetSpellShield());
|
||||
mod2b = CastToBot()->GetSpellShield();
|
||||
} else if (IsClient()) {
|
||||
mod2b = Strings::Commify(CastToClient()->GetSpellShield());
|
||||
mod2b = CastToClient()->GetSpellShield();
|
||||
}
|
||||
|
||||
break;
|
||||
@ -2109,19 +2109,19 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
|
||||
case 3: {
|
||||
mod2a_name = "Stun Resist";
|
||||
mod2b_name = "DOT Shielding";
|
||||
mod2a_cap = Strings::Commify(RuleI(Character, ItemStunResistCap));
|
||||
mod2b_cap = Strings::Commify(RuleI(Character, ItemDoTShieldingCap));
|
||||
mod2a_cap = RuleI(Character, ItemStunResistCap);
|
||||
mod2b_cap = RuleI(Character, ItemDoTShieldingCap);
|
||||
|
||||
if (IsBot()) {
|
||||
mod2a = Strings::Commify(CastToBot()->GetStunResist());
|
||||
mod2a = CastToBot()->GetStunResist();
|
||||
} else if (IsClient()) {
|
||||
mod2a = Strings::Commify(CastToClient()->GetStunResist());
|
||||
mod2a = CastToClient()->GetStunResist();
|
||||
}
|
||||
|
||||
if (IsBot()) {
|
||||
mod2b = Strings::Commify(CastToBot()->GetDoTShield());
|
||||
mod2b = CastToBot()->GetDoTShield();
|
||||
} else if (IsClient()) {
|
||||
mod2b = Strings::Commify(CastToClient()->GetDoTShield());
|
||||
mod2b = CastToClient()->GetDoTShield();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user