[Cleanup] Use explicit conversions for enum formatting (#4064)

This is prep for updating to fmt 10 which removed implicit conversions
for enums.
This commit is contained in:
hg
2024-02-12 03:58:48 -05:00
committed by GitHub
parent 20c01ef343
commit e920e35a5c
21 changed files with 33 additions and 17 deletions
+2 -2
View File
@@ -343,7 +343,7 @@ void NPC::DescribeAggro(Client *to_who, Mob *mob, bool verbose) {
"{} does not have low enough faction, their Faction Level is {} ({}).",
to_who->GetTargetDescription(mob),
FactionValueToString(faction_value),
faction_value
static_cast<int>(faction_value)
).c_str()
);
return;
@@ -556,7 +556,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
LogAggro("Is In zone?:[{}]\n", mob->InZone());
LogAggro("Dist^2: [{}]\n", distance_squared);
LogAggro("Range^2: [{}]\n", aggro_range_squared);
LogAggro("Faction: [{}]\n", faction_value);
LogAggro("Faction: [{}]\n", static_cast<int>(faction_value));
LogAggro("AlwaysAggroFlag: [{}]\n", AlwaysAggro());
LogAggro("Int: [{}]\n", GetINT());
LogAggro("Con: [{}]\n", GetLevelCon(mob->GetLevel()));
+1 -1
View File
@@ -1107,7 +1107,7 @@ void bot_command_stance(Client *c, const Seperator *sep)
fmt::format(
"My current stance is {} ({}).",
EQ::constants::GetStanceName(bot_iter->GetBotStance()),
bot_iter->GetBotStance()
static_cast<int>(bot_iter->GetBotStance())
).c_str()
);
}
+1 -1
View File
@@ -6955,7 +6955,7 @@ void Client::ShowXTargets(Client *c)
fmt::format(
"xtarget slot [{}] type [{}] ID [{}] name [{}]",
i,
XTargets[i].Type,
static_cast<int>(XTargets[i].Type),
XTargets[i].ID,
strlen(XTargets[i].Name) ? XTargets[i].Name : "No Name"
).c_str()
+2 -2
View File
@@ -516,7 +516,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
case CLIENT_LINKDEAD:
break;
default:
LogDebug("Unknown client_state: [{}]\n", client_state);
LogDebug("Unknown client_state: [{}]\n", static_cast<int>(client_state));
break;
}
@@ -16342,7 +16342,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app)
}
default:
LogDebug("Unhandled XTarget Type [{}]", Type);
LogDebug("Unhandled XTarget Type [{}]", static_cast<int>(Type));
break;
}
+2 -2
View File
@@ -410,7 +410,7 @@ void DataBucket::BulkLoadEntities(DataBucketLoadType::Type t, std::vector<uint32
column = "npc_id";
break;
default:
LogError("Incorrect LoadType [{}]", t);
LogError("Incorrect LoadType [{}]", static_cast<int>(t));
break;
}
@@ -546,7 +546,7 @@ void DataBucket::HandleWorldMessage(ServerPacket *p)
n.e.id,
n.e.key_,
n.e.value,
n.update_action
static_cast<int>(n.update_action)
);
// delete
+1 -1
View File
@@ -2521,7 +2521,7 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
CastToClient()->GetPVP() ? "Yes" : "No",
CastToClient()->GetGM() ? "On" : "Off",
EQ::constants::GetFlyModeName(static_cast<uint8>(flymode)),
flymode,
static_cast<int>(flymode),
CastToClient()->GetGMSpeed() ? "On" : "Off",
CastToClient()->GetHideMe() ? "On" : "Off",
CastToClient()->GetGMInvul() ? "On" : "Off",
+1 -1
View File
@@ -1487,7 +1487,7 @@ void MobMovementManager::PushEvadeCombat(MobMovementEntry &mob_movement_entry)
*/
void MobMovementManager::HandleStuckBehavior(Mob *who, float x, float y, float z, MobMovementMode mob_movement_mode)
{
LogDebug("Handle stuck behavior for {0} at ({1}, {2}, {3}) with movement_mode {4}", who->GetName(), x, y, z, mob_movement_mode);
LogDebug("Handle stuck behavior for {0} at ({1}, {2}, {3}) with movement_mode {4}", who->GetName(), x, y, z, static_cast<int>(mob_movement_mode));
auto sb = who->GetStuckBehavior();
MobStuckBehavior behavior = RunToTarget;
+3
View File
@@ -169,4 +169,7 @@ protected:
TimeOfDay_Struct next_event;
};
constexpr int format_as(SpawnCondition::OnChange val) { return static_cast<int>(val); }
constexpr int format_as(SpawnEvent::Action val) { return static_cast<int>(val); }
#endif
+3 -3
View File
@@ -407,7 +407,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
spell.target_type == ST_Beam
) && target_id == 0
) {
LogSpells("Spell [{}] auto-targeted the caster. Group? [{}], target type [{}]", spell_id, IsGroupSpell(spell_id), spell.target_type);
LogSpells("Spell [{}] auto-targeted the caster. Group? [{}], target type [{}]", spell_id, IsGroupSpell(spell_id), static_cast<int>(spell.target_type));
target_id = GetID();
}
@@ -2383,7 +2383,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
default:
{
LogSpells("I dont know Target Type: [{}] Spell: ([{}]) [{}]", spells[spell_id].target_type, spell_id, spells[spell_id].name);
LogSpells("I dont know Target Type: [{}] Spell: ([{}]) [{}]", static_cast<int>(spells[spell_id].target_type), spell_id, spells[spell_id].name);
Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].target_type, spell_id, spells[spell_id].name);
CastAction = CastActUnknown;
break;
@@ -2461,7 +2461,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in
}
}
LogSpells("Spell [{}]: target type [{}], target [{}], AE center [{}]", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE");
LogSpells("Spell [{}]: target type [{}], target [{}], AE center [{}]", spell_id, static_cast<int>(CastAction), spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE");
// if a spell has the AEDuration flag, it becomes an AE on target
// spell that's recast every 2500 msec for AEDuration msec.
+1 -1
View File
@@ -256,7 +256,7 @@ bool TaskManager::LoadTasks(int single_task)
activity_id,
task_data->activity_count,
static_cast<int32_t>(ad->activity_type),
ad->goal_method,
static_cast<int32_t>(ad->goal_method),
ad->goal_count,
ad->zones.c_str(),
ad->target_name.c_str(),
+1 -1
View File
@@ -746,7 +746,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
z,
heading,
ignorerestrictions,
zm
static_cast<int>(zm)
);
cheat_manager.SetExemptStatus(Port, true);