Skip to content

Commit

Permalink
Fix for broken chat messages #187 (#189)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
FingerKnoten authored Sep 10, 2024
1 parent f1b10a7 commit 5d2778e
Show file tree
Hide file tree
Showing 2 changed files with 279 additions and 279 deletions.
6 changes: 3 additions & 3 deletions src/AutoBalance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6494,7 +6494,7 @@ class AutoBalance_CommandScript : public CommandScript
{
handler->PSendSysMessage("---");
// Map basics
handler->PSendSysMessage("%s (%u-player %s) | ID %u-%u%s",
handler->PSendSysMessage("{} ({}-player {}) | ID {}-{}{}",
player->GetMap()->GetMapName(),
player->GetMap()->ToInstanceMap()->GetMaxPlayers(),
player->GetMap()->ToInstanceMap()->IsHeroic() ? "Heroic" : "Normal",
Expand All @@ -6506,7 +6506,7 @@ class AutoBalance_CommandScript : public CommandScript
// if (!mapABInfo->enabled) { return true; }

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

handler->PSendSysMessage("---");
handler->PSendSysMessage("%s (%u%s%s), %s",
handler->PSendSysMessage("{} ({}{}{}), {}",
target->GetName(),
targetABInfo->UnmodifiedLevel,
isCreatureRelevant(target) && targetABInfo->UnmodifiedLevel != target->GetLevel() ? "->" + std::to_string(targetABInfo->selectedLevel) : "",
Expand Down
Loading

0 comments on commit 5d2778e

Please sign in to comment.