Skip to content

Commit 5d2778e

Browse files
authored
Fix for broken chat messages #187 (#189)
* Fix(Core/Misc): Acore::StringFormat to fmt format Fixes the issue that variables are not properly replaced. Instead placeholders %s,%u and %i were shown in chat. Closes issue #187 * Fix(Core/Misc): Acore::StringFormat to fmt format Fixes the issue that variables are not properly replaced. Instead placeholders %.2f and %.3f were shown in chat. Closes issue #187 * Adjusted format for float placehodlers Makes sure the original formatting for float placeholders still fits Closes issue #187
1 parent f1b10a7 commit 5d2778e

File tree

2 files changed

+279
-279
lines changed

2 files changed

+279
-279
lines changed

src/AutoBalance.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6494,7 +6494,7 @@ class AutoBalance_CommandScript : public CommandScript
64946494
{
64956495
handler->PSendSysMessage("---");
64966496
// Map basics
6497-
handler->PSendSysMessage("%s (%u-player %s) | ID %u-%u%s",
6497+
handler->PSendSysMessage("{} ({}-player {}) | ID {}-{}{}",
64986498
player->GetMap()->GetMapName(),
64996499
player->GetMap()->ToInstanceMap()->GetMaxPlayers(),
65006500
player->GetMap()->ToInstanceMap()->IsHeroic() ? "Heroic" : "Normal",
@@ -6506,7 +6506,7 @@ class AutoBalance_CommandScript : public CommandScript
65066506
// if (!mapABInfo->enabled) { return true; }
65076507

65086508
// Player stats
6509-
handler->PSendSysMessage("Players on map: %u (Lvl %u - %u)",
6509+
handler->PSendSysMessage("Players on map: {} (Lvl {} - {})",
65106510
mapABInfo->playerCount,
65116511
mapABInfo->lowestPlayerLevel,
65126512
mapABInfo->highestPlayerLevel
@@ -6603,7 +6603,7 @@ class AutoBalance_CommandScript : public CommandScript
66036603
AutoBalanceCreatureInfo *targetABInfo=target->CustomData.GetDefault<AutoBalanceCreatureInfo>("AutoBalanceCreatureInfo");
66046604

66056605
handler->PSendSysMessage("---");
6606-
handler->PSendSysMessage("%s (%u%s%s), %s",
6606+
handler->PSendSysMessage("{} ({}{}{}), {}",
66076607
target->GetName(),
66086608
targetABInfo->UnmodifiedLevel,
66096609
isCreatureRelevant(target) && targetABInfo->UnmodifiedLevel != target->GetLevel() ? "->" + std::to_string(targetABInfo->selectedLevel) : "",

0 commit comments

Comments
 (0)