Skip to content

Commit

Permalink
fix more fmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored Aug 25, 2024
1 parent 1281c9b commit af09880
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/cs_transmog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class transmog_commandscript : public CommandScript
Player* player = handler->GetPlayer();
uint32 accountId = player->GetSession()->GetAccountId();
handler->SendSysMessage(LANG_CMD_TRANSMOG_BEGIN_SYNC);

for (uint32 itemId : sTransmogrification->collectionCache[accountId])
{
handler->PSendSysMessage("TRANSMOG_SYNC:%u", itemId);
}
handler->PSendSysMessage("TRANSMOG_SYNC:{}", itemId);

handler->SendSysMessage(LANG_CMD_TRANSMOG_COMPLETE_SYNC);
return true;
}
Expand Down Expand Up @@ -158,15 +158,11 @@ class transmog_commandscript : public CommandScript
{
// Notify target of new item in appearance collection
if (target && !(target->GetPlayerSetting("mod-transmog", SETTING_HIDE_TRANSMOG).value) && !sTransmogrification->CanNeverTransmog(itemTemplate))
{
ChatHandler(target->GetSession()).PSendSysMessage(R"(|c%s|Hitem:%u:0:0:0:0:0:0:0:0|h[%s]|h|r has been added to your appearance collection.)", itemQuality.c_str(), itemId, itemName.c_str());
}
ChatHandler(target->GetSession()).PSendSysMessage(R"(|c{}|Hitem:{}:0:0:0:0:0:0:0:0|h[{}]|h|r has been added to your appearance collection.)", itemQuality.c_str(), itemId, itemName.c_str());

// Feedback of successful command execution to GM
if (isNotConsole && target != handler->GetPlayer())
{
handler->PSendSysMessage(R"(|c%s|Hitem:%u:0:0:0:0:0:0:0:0|h[%s]|h|r has been added to the appearance collection of Player %s.)", itemQuality.c_str(), itemId, itemName.c_str(), nameLink);
}
handler->PSendSysMessage(R"(|c{}|Hitem:{}:0:0:0:0:0:0:0:0|h[{}]|h|r has been added to the appearance collection of Player {}.)", itemQuality.c_str(), itemId, itemName.c_str(), nameLink);

CharacterDatabase.Execute("INSERT INTO custom_unlocked_appearances (account_id, item_template_id) VALUES ({}, {})", accountId, itemId);
}
Expand All @@ -175,7 +171,7 @@ class transmog_commandscript : public CommandScript
// Feedback of failed command execution to GM
if (isNotConsole)
{
handler->PSendSysMessage(R"(Player %s already has item |c%s|Hitem:%u:0:0:0:0:0:0:0:0|h[%s]|h|r in the appearance collection.)", nameLink, itemQuality.c_str(), itemId, itemName.c_str());
handler->PSendSysMessage(R"(Player {} already has item |c{}|Hitem:{}:0:0:0:0:0:0:0:0|h[{}]|h|r in the appearance collection.)", nameLink, itemQuality.c_str(), itemId, itemName.c_str());
handler->SetSentErrorMessage(true);
}
}
Expand Down Expand Up @@ -274,22 +270,22 @@ class transmog_commandscript : public CommandScript
// Failed command execution
if (!added)
{
handler->PSendSysMessage("Player %s already has ItemSet |cffffffff|Hitemset:%d|h[%s %s]|h|r in the appearance collection.", nameLink, uint32(itemSetId), setName.c_str(), localeNames[locale]);
handler->PSendSysMessage("Player {} already has ItemSet |cffffffff|Hitemset:{}|h[{} {}]|h|r in the appearance collection.", nameLink, uint32(itemSetId), setName.c_str(), localeNames[locale]);
handler->SetSentErrorMessage(true);
return true;
}

// Successful command execution
if (target != handler->GetPlayer())
{
handler->PSendSysMessage("ItemSet |cffffffff|Hitemset:%d|h[%s %s]|h|r has been added to the appearance collection of Player %s.", uint32(itemSetId), setName.c_str(), localeNames[locale], nameLink);
handler->PSendSysMessage("ItemSet |cffffffff|Hitemset:{}|h[{} {}]|h|r has been added to the appearance collection of Player {}.", uint32(itemSetId), setName.c_str(), localeNames[locale], nameLink);
}
}

// Notify target of new item in appearance collection
if (target && !(target->GetPlayerSetting("mod-transmog", SETTING_HIDE_TRANSMOG).value))
{
ChatHandler(target->GetSession()).PSendSysMessage("ItemSet |cffffffff|Hitemset:%d|h[%s %s]|h|r has been added to your appearance collection.", uint32(itemSetId), setName.c_str(), localeNames[locale]);
ChatHandler(target->GetSession()).PSendSysMessage("ItemSet |cffffffff|Hitemset:%d|h[{} {}]|h|r has been added to your appearance collection.", uint32(itemSetId), setName.c_str(), localeNames[locale]);
}

return true;
Expand Down

0 comments on commit af09880

Please sign in to comment.