Skip to content

Commit

Permalink
fix: fix for failing build (#426)
Browse files Browse the repository at this point in the history
Fix build failure by removing temporary values from format args
  • Loading branch information
IrateRedKite authored Jun 14, 2024
1 parent 908732d commit 551f449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions plugins/kill_tracker/KillTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace Plugins::KillTracker
* @brief Keeps track of the kills of the player during their current session
*/
void TrackKillStreaks(ClientId& clientVictim, ClientId& clientKiller = NULL)
{
{
if (clientKiller != NULL)
{
if (auto killerKillStreak = global->killStreaks.find(clientKiller); killerKillStreak != global->killStreaks.end())
Expand All @@ -102,7 +102,7 @@ namespace Plugins::KillTracker
global->killStreaks[clientKiller] = 1;
};
}

if (auto victimKillStreak = global->killStreaks.find(clientVictim); victimKillStreak != global->killStreaks.end())
{
global->killStreaks[clientVictim] = 0;
Expand Down Expand Up @@ -198,8 +198,9 @@ namespace Plugins::KillTracker
return;
std::wstring victimName = Hk::Client::GetCharacterNameByID(clientVictim).value();
std::wstring greatestInflictorName = Hk::Client::GetCharacterNameByID(greatestInflictorId).value();
std::wstring greatestDamageMessage = std::vformat(global->config->deathDamageTemplate,
std::make_wformat_args(victimName, greatestInflictorName, static_cast<uint>(ceil((greatestDamageDealt / totalDamageTaken) * 100))));
auto damage = static_cast<uint>(ceil((greatestDamageDealt / totalDamageTaken) * 100));
std::wstring greatestDamageMessage =
std::vformat(global->config->deathDamageTemplate, std::make_wformat_args(victimName, greatestInflictorName, damage));

greatestDamageMessage = Hk::Message::FormatMsg(MessageColor::Orange, MessageFormat::Normal, greatestDamageMessage);
Hk::Message::FMsgS(system, greatestDamageMessage);
Expand All @@ -220,8 +221,7 @@ namespace Plugins::KillTracker
const auto templateMessage = global->killStreakTemplates.find(numKills);
if (templateMessage != global->killStreakTemplates.end())
{
std::wstring killStreakMessage =
std::vformat(templateMessage->second, std::make_wformat_args(killerName, victimName, numKills));
std::wstring killStreakMessage = std::vformat(templateMessage->second, std::make_wformat_args(killerName, victimName, numKills));
killStreakMessage = Hk::Message::FormatMsg(MessageColor::Orange, MessageFormat::Normal, killStreakMessage);
Hk::Message::FMsgS(system, killStreakMessage);
}
Expand Down Expand Up @@ -305,7 +305,7 @@ namespace Plugins::KillTracker
global->config = std::make_unique<Config>(config);
for (auto& subArray : global->damageArray)
subArray.fill(0.0f);
for (auto const& killStreakTemplate : global->config->killStreakTemplates)
for (auto const& killStreakTemplate : global->config->killStreakTemplates)
{
global->killStreakTemplates[killStreakTemplate.number] = killStreakTemplate.message;
}
Expand All @@ -319,7 +319,8 @@ namespace Plugins::KillTracker
using namespace Plugins::KillTracker;

REFL_AUTO(type(KillMessage), field(number), field(message));
REFL_AUTO(type(Config), field(enableNPCKillOutput), field(deathDamageTemplate), field(enableDamageTracking), field(killStreakTemplates), field(milestoneTemplates));
REFL_AUTO(
type(Config), field(enableNPCKillOutput), field(deathDamageTemplate), field(enableDamageTracking), field(killStreakTemplates), field(milestoneTemplates));

DefaultDllMainSettings(LoadSettings);

Expand Down
2 changes: 1 addition & 1 deletion plugins/tax/Tax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace Plugins::Tax
if (taxValue == 0)
msg = Hk::Message::FormatMsg(global->config->customColor,
global->config->customFormat,
std::vformat(global->config->huntingMessage, std::make_wformat_args(characterName.value().c_str())));
std::vformat(global->config->huntingMessage, std::make_wformat_args(characterName.value())));
else
msg = Hk::Message::FormatMsg(global->config->customColor,
global->config->customFormat,
Expand Down

0 comments on commit 551f449

Please sign in to comment.