From 5b6655804052e534810c5cf979ff8f239c289f68 Mon Sep 17 00:00:00 2001 From: Corey Sotiropoulos Date: Wed, 11 Mar 2026 07:43:39 +0000 Subject: [PATCH] Update to clang-format-22 --- src/map/action/interrupts.cpp | 182 ++++++++++++------------ src/map/ai/states/ability_state.cpp | 10 +- src/map/ai/states/item_state.cpp | 8 +- src/map/ai/states/magic_state.cpp | 8 +- src/map/ai/states/mobskill_state.cpp | 8 +- src/map/ai/states/petskill_state.cpp | 8 +- src/map/ai/states/range_state.cpp | 4 +- src/map/ai/states/weaponskill_state.cpp | 8 +- src/map/latent_effect_container.cpp | 6 +- src/map/lua/lua_baseentity.cpp | 24 ++-- src/map/lua/luautils.cpp | 10 +- src/map/mob_spell_container.cpp | 30 ++-- src/map/navmesh/navmesh_builder.cpp | 4 +- src/map/packets/c2s/0x05e_maprect.cpp | 6 +- src/map/packets/s2c/0x08c_merit.cpp | 6 +- src/map/utils/mobutils.cpp | 8 +- src/map/ximesh/ximesh.cpp | 20 +-- src/search/data_loader.cpp | 2 +- src/test/test_application.cpp | 72 +++++----- tools/run_clang_format.py | 18 +-- 20 files changed, 221 insertions(+), 221 deletions(-) diff --git a/src/map/action/interrupts.cpp b/src/map/action/interrupts.cpp index 7c15660a04f..ad7c1aa95c4 100644 --- a/src/map/action/interrupts.cpp +++ b/src/map/action/interrupts.cpp @@ -38,12 +38,12 @@ void AvatarOutOfRange(CBattleEntity* PAvatar, const CPetSkill* PSkill, const CBa .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .param = PSkill->getMobSkillID() > 0 ? PSkill->getMobSkillID() : PSkill->getID(), - .messageID = MsgBasic::TooFarAwayRed, + .animation = ActionAnimation::SkillInterrupt, + .param = PSkill->getMobSkillID() > 0 ? PSkill->getMobSkillID() : PSkill->getID(), + .messageID = MsgBasic::TooFarAwayRed, }, }, }, @@ -57,10 +57,10 @@ void AvatarOutOfRange(CBattleEntity* PAvatar, const CPetSkill* PSkill, const CBa .actionid = static_cast(FourCC::SkillInterrupt), .targets = { { - .actorId = PAvatar->id, - .results = { + .actorId = PAvatar->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, + .animation = ActionAnimation::SkillInterrupt, }, }, }, @@ -83,13 +83,13 @@ void WyvernOutOfRange(CBattleEntity* PWyvern, const CPetSkill* PSkill, const CBa .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .resolution = ActionResolution::Miss, - .animation = ActionAnimation::SkillInterrupt, - .param = PSkill->getMobSkillID() > 0 ? PSkill->getMobSkillID() : PSkill->getID(), - .messageID = MsgBasic::TooFarAwayRed, + .resolution = ActionResolution::Miss, + .animation = ActionAnimation::SkillInterrupt, + .param = PSkill->getMobSkillID() > 0 ? PSkill->getMobSkillID() : PSkill->getID(), + .messageID = MsgBasic::TooFarAwayRed, }, }, }, @@ -103,10 +103,10 @@ void WyvernOutOfRange(CBattleEntity* PWyvern, const CPetSkill* PSkill, const CBa .actionid = static_cast(FourCC::SkillInterrupt), .targets = { { - .actorId = PWyvern->id, - .results = { + .actorId = PWyvern->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, + .animation = ActionAnimation::SkillInterrupt, }, }, }, @@ -125,8 +125,8 @@ void WyvernSkillReady(CBattleEntity* PWyvern) .actionid = static_cast(FourCC::SkillInterrupt), .targets = { { - .actorId = PWyvern->id, - .results = { + .actorId = PWyvern->id, + .results = { { // Empty result }, @@ -146,8 +146,8 @@ void AbilityInterrupt(CBattleEntity* PEntity) .actionid = static_cast(FourCC::SkillInterrupt), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { // Empty result }, @@ -167,10 +167,10 @@ void RangedInterrupt(CBattleEntity* PEntity) .actionid = static_cast(FourCC::RangedInterrupt), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, + .animation = ActionAnimation::SkillInterrupt, }, }, }, @@ -187,11 +187,11 @@ void MobSkillNoTargetInRange(CBattleEntity* PEntity) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::NoTargetInAreaOfEffect, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::NoTargetInAreaOfEffect, }, }, }, @@ -208,11 +208,11 @@ void MobSkillOutOfRange(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::TooFarAway, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::TooFarAway, }, }, }, @@ -229,11 +229,11 @@ void WeaponSkillOutOfRange(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::TooFarAway, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::TooFarAway, }, }, }, @@ -250,11 +250,11 @@ void RangedParalyzed(CBattleEntity* PEntity) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsParalyzed2, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsParalyzed2, }, }, }, @@ -273,10 +273,10 @@ void MagicInterrupt(CBattleEntity* PEntity, CSpell* PSpell) .actionid = static_cast(PSpell->getFourCC(true)), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .param = static_cast(PSpell->getID()), + .param = static_cast(PSpell->getID()), }, }, }, @@ -295,11 +295,11 @@ void MagicParalyzed(CBattleEntity* PEntity, CSpell* PSpell, const CBattleEntity* .recast = 2s, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsParalyzed2, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsParalyzed2, }, }, }, @@ -312,11 +312,11 @@ void MagicParalyzed(CBattleEntity* PEntity, CSpell* PSpell, const CBattleEntity* .actionid = static_cast(PSpell->getFourCC(true)), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .param = static_cast(PSpell->getID()), + .animation = ActionAnimation::SkillInterrupt, + .param = static_cast(PSpell->getID()), }, }, }, @@ -336,11 +336,11 @@ void MagicIntimidated(CBattleEntity* PEntity, CSpell* PSpell, const CBattleEntit .recast = 2s, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsIntimidated, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsIntimidated, }, }, }, @@ -354,11 +354,11 @@ void MagicIntimidated(CBattleEntity* PEntity, CSpell* PSpell, const CBattleEntit .recast = 2s, .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .param = static_cast(PSpell->getID()), + .animation = ActionAnimation::SkillInterrupt, + .param = static_cast(PSpell->getID()), }, }, }, @@ -376,11 +376,11 @@ void AttackParalyzed(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsParalyzed2, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsParalyzed2, }, }, }, @@ -397,11 +397,11 @@ void AttackIntimidated(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsIntimidated, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsIntimidated, }, }, }, @@ -419,11 +419,11 @@ void AbilityParalyzed(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsParalyzed2, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsParalyzed2, }, }, }, @@ -436,11 +436,11 @@ void AbilityParalyzed(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsParalyzed2, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsParalyzed2, }, }, }, @@ -459,8 +459,8 @@ void ItemInterrupt(CBattleEntity* PEntity) .actionid = static_cast(FourCC::ItemInterrupt), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { // Empty result }, @@ -480,11 +480,11 @@ void ItemParalyzed(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsParalyzed2, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsParalyzed2, }, }, }, @@ -498,10 +498,10 @@ void ItemParalyzed(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actionid = static_cast(FourCC::ItemInterrupt), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, + .animation = ActionAnimation::SkillInterrupt, }, }, }, @@ -520,11 +520,11 @@ void ItemIntimidated(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actiontype = ActionCategory::MagicFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, - .messageID = MsgBasic::IsIntimidated, + .animation = ActionAnimation::SkillInterrupt, + .messageID = MsgBasic::IsIntimidated, }, }, }, @@ -538,10 +538,10 @@ void ItemIntimidated(CBattleEntity* PEntity, const CBattleEntity* PTarget) .actionid = static_cast(FourCC::ItemInterrupt), .targets = { { - .actorId = PEntity->id, - .results = { + .actorId = PEntity->id, + .results = { { - .animation = ActionAnimation::SkillInterrupt, + .animation = ActionAnimation::SkillInterrupt, }, }, }, diff --git a/src/map/ai/states/ability_state.cpp b/src/map/ai/states/ability_state.cpp index 3827609c995..3f78efa3966 100644 --- a/src/map/ai/states/ability_state.cpp +++ b/src/map/ai/states/ability_state.cpp @@ -131,12 +131,12 @@ CAbilityState::CAbilityState(CBattleEntity* PEntity, uint16 targid, uint16 abili .actiontype = ActionCategory::AbilityStart, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = ActionAnimation::SkillStart, - .param = PAbility->getID(), - .messageID = MsgBasic::ReadiesSkill, + .animation = ActionAnimation::SkillStart, + .param = PAbility->getID(), + .messageID = MsgBasic::ReadiesSkill, }, }, }, diff --git a/src/map/ai/states/item_state.cpp b/src/map/ai/states/item_state.cpp index 0e9ea68b0c9..2a3ec000386 100644 --- a/src/map/ai/states/item_state.cpp +++ b/src/map/ai/states/item_state.cpp @@ -130,11 +130,11 @@ CItemState::CItemState(CCharEntity* PEntity, const uint16 targid, const uint8 lo .actionid = static_cast(FourCC::ItemUse), .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .param = m_PItem->getID(), - .messageID = MsgBasic::ItemUse, + .param = m_PItem->getID(), + .messageID = MsgBasic::ItemUse, }, }, }, diff --git a/src/map/ai/states/magic_state.cpp b/src/map/ai/states/magic_state.cpp index 34a961b7802..ffe418437be 100644 --- a/src/map/ai/states/magic_state.cpp +++ b/src/map/ai/states/magic_state.cpp @@ -103,11 +103,11 @@ CMagicState::CMagicState(CBattleEntity* PEntity, uint16 targid, SpellID spellid, .spellgroup = m_PSpell->getSpellGroup(), .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .param = static_cast(m_PSpell->getID()), - .messageID = PEntity->objtype != TYPE_PC ? MsgBasic::StartsCastingSelf : MsgBasic::StartsCastingTarget, + .param = static_cast(m_PSpell->getID()), + .messageID = PEntity->objtype != TYPE_PC ? MsgBasic::StartsCastingSelf : MsgBasic::StartsCastingTarget, }, }, }, diff --git a/src/map/ai/states/mobskill_state.cpp b/src/map/ai/states/mobskill_state.cpp index 24a03bcba30..4fb4abe2061 100644 --- a/src/map/ai/states/mobskill_state.cpp +++ b/src/map/ai/states/mobskill_state.cpp @@ -99,11 +99,11 @@ CMobSkillState::CMobSkillState(CBattleEntity* PEntity, uint16 targid, uint16 wsi .actionid = static_cast(FourCC::SkillUse), .targets = { { - .actorId = PActionTarget ? PActionTarget->id : m_PEntity->id, - .results = { + .actorId = PActionTarget ? PActionTarget->id : m_PEntity->id, + .results = { { - .param = m_PSkill->getID(), - .messageID = m_PSkill->getFlag() & SKILLFLAG_NO_START_MSG ? MsgBasic::None : MsgBasic::ReadiesWeaponskill, + .param = m_PSkill->getID(), + .messageID = m_PSkill->getFlag() & SKILLFLAG_NO_START_MSG ? MsgBasic::None : MsgBasic::ReadiesWeaponskill, }, }, }, diff --git a/src/map/ai/states/petskill_state.cpp b/src/map/ai/states/petskill_state.cpp index 4d2e974d8f8..abd3e4abb15 100644 --- a/src/map/ai/states/petskill_state.cpp +++ b/src/map/ai/states/petskill_state.cpp @@ -73,11 +73,11 @@ CPetSkillState::CPetSkillState(CPetEntity* PEntity, uint16 targid, uint16 wsid) .actionid = static_cast(FourCC::SkillUse), .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .param = m_PSkill->getMobSkillID() > 0 ? m_PSkill->getMobSkillID() : m_PSkill->getID(), - .messageID = m_PSkill->getMobSkillID() > 0 ? MsgBasic::ReadiesWeaponskill : MsgBasic::ReadiesSkill, + .param = m_PSkill->getMobSkillID() > 0 ? m_PSkill->getMobSkillID() : m_PSkill->getID(), + .messageID = m_PSkill->getMobSkillID() > 0 ? MsgBasic::ReadiesWeaponskill : MsgBasic::ReadiesSkill, }, }, }, diff --git a/src/map/ai/states/range_state.cpp b/src/map/ai/states/range_state.cpp index f8079cbac37..49824c48967 100644 --- a/src/map/ai/states/range_state.cpp +++ b/src/map/ai/states/range_state.cpp @@ -126,8 +126,8 @@ CRangeState::CRangeState(CBattleEntity* PEntity, uint16 targid) .actionid = static_cast(FourCC::RangedStart), .targets = { { - .actorId = m_PEntity->id, - .results = { + .actorId = m_PEntity->id, + .results = { { // Empty result }, diff --git a/src/map/ai/states/weaponskill_state.cpp b/src/map/ai/states/weaponskill_state.cpp index 742ee81be85..a0af8a279ce 100644 --- a/src/map/ai/states/weaponskill_state.cpp +++ b/src/map/ai/states/weaponskill_state.cpp @@ -70,11 +70,11 @@ CWeaponSkillState::CWeaponSkillState(CBattleEntity* PEntity, uint16 targid, uint .actionid = static_cast(FourCC::SkillUse), .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .param = m_PSkill->getID(), - .messageID = MsgBasic::ReadiesWeaponskill, + .param = m_PSkill->getID(), + .messageID = MsgBasic::ReadiesWeaponskill, }, }, }, diff --git a/src/map/latent_effect_container.cpp b/src/map/latent_effect_container.cpp index 1b855ed4e5d..fc191da9c6e 100644 --- a/src/map/latent_effect_container.cpp +++ b/src/map/latent_effect_container.cpp @@ -832,9 +832,9 @@ bool CLatentEffectContainer::ProcessLatentEffect(CLatentEffect& latentEffect, bo { CBattleEntity* PTarget = m_POwner->GetBattleTarget(); expression = PTarget != nullptr && - m_POwner->GetMLevel() >= PTarget->GetMLevel() && - m_POwner->loc.zone != nullptr && - m_POwner->loc.zone->GetRegionID() < REGION_TYPE::WEST_AHT_URHGAN; + m_POwner->GetMLevel() >= PTarget->GetMLevel() && + m_POwner->loc.zone != nullptr && + m_POwner->loc.zone->GetRegionID() < REGION_TYPE::WEST_AHT_URHGAN; break; } case LATENT::SANCTION_REGEN_BONUS: diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 66f595b9711..043f5179c68 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -958,14 +958,14 @@ void CLuaBaseEntity::injectActionPacket(const uint32 inTargetID, uint16 inCatego .actionid = inActionParam, .targets = { { - .actorId = inTargetID, - .results = { + .actorId = inTargetID, + .results = { { - .resolution = reaction, - .animation = static_cast(inAnimationID), - .info = info, - .param = inParam, - .messageID = static_cast(inMessage), + .resolution = reaction, + .animation = static_cast(inAnimationID), + .info = info, + .param = inParam, + .messageID = static_cast(inMessage), }, }, }, @@ -19288,12 +19288,12 @@ void CLuaBaseEntity::restoreFromChest(CLuaBaseEntity* PLuaBaseEntity, uint32 res .actiontype = ActionCategory::MobSkillFinish, .targets = { { - .actorId = PChar->id, - .results = { + .actorId = PChar->id, + .results = { { - .animation = animationID, - .param = messageParam, - .messageID = messageID, + .animation = animationID, + .param = messageParam, + .messageID = messageID, }, }, }, diff --git a/src/map/lua/luautils.cpp b/src/map/lua/luautils.cpp index f2f3924903e..d6f77699f3b 100644 --- a/src/map/lua/luautils.cpp +++ b/src/map/lua/luautils.cpp @@ -1109,8 +1109,8 @@ void PopulateIDLookups(uint16 zoneId, const std::string& zoneName) const auto rset = db::preparedStmt("SELECT mobname, mobid FROM mob_spawn_points " "WHERE mobid BETWEEN ? AND ? " "ORDER BY mobid ASC", - idMin, - idMax); + idMin, + idMax); FOR_DB_MULTIPLE_RESULTS(rset) { const auto name = rset->get("mobname"); @@ -1127,8 +1127,8 @@ void PopulateIDLookups(uint16 zoneId, const std::string& zoneName) const auto rset = db::preparedStmt("SELECT name, npcid FROM npc_list " "WHERE npcid BETWEEN ? AND ? " "ORDER BY npcid ASC", - idMin, - idMax); + idMin, + idMax); FOR_DB_MULTIPLE_RESULTS(rset) { const auto name = rset->get("name"); @@ -1706,7 +1706,7 @@ auto LoadLinkshellConciergeSlots(uint16 zoneId) -> sol::table "FROM linkshell_concierge lc " "JOIN linkshells ls ON ls.linkshellid = lc.linkshellid " "WHERE lc.zone_id = ? AND ls.broken = 0", - zoneId); + zoneId); if (!rset) { return result; diff --git a/src/map/mob_spell_container.cpp b/src/map/mob_spell_container.cpp index 0e78af1f24f..4b98011ccdb 100644 --- a/src/map/mob_spell_container.cpp +++ b/src/map/mob_spell_container.cpp @@ -130,12 +130,12 @@ Maybe CMobSpellContainer::GetAvailable(SpellID spellId) { auto* spell = spell::GetSpell(spellId); bool enoughMP = spell->getMPCost() <= m_PMob->health.mp || - spell->getSkillType() == SKILL_NINJUTSU || - spell->getSkillType() == SKILL_SINGING || - spell->getSkillType() == SKILL_WIND_INSTRUMENT || - spell->getSkillType() == SKILL_STRING_INSTRUMENT || - spell->getSkillType() == SKILL_GEOMANCY || - m_PMob->StatusEffectContainer->HasStatusEffect(EFFECT_MANAFONT); + spell->getSkillType() == SKILL_NINJUTSU || + spell->getSkillType() == SKILL_SINGING || + spell->getSkillType() == SKILL_WIND_INSTRUMENT || + spell->getSkillType() == SKILL_STRING_INSTRUMENT || + spell->getSkillType() == SKILL_GEOMANCY || + m_PMob->StatusEffectContainer->HasStatusEffect(EFFECT_MANAFONT); bool isNotInRecast = !m_PMob->PRecastContainer->Has(RECAST_MAGIC, static_cast(spellId)); @@ -150,15 +150,15 @@ Maybe CMobSpellContainer::GetBestAvailable(SPELLFAMILY family) { for (auto id : list) { - auto* spell = spell::GetSpell(id); - bool sameFamily = (family == SPELLFAMILY_NONE) ? true : spell->getSpellFamily() == family; - bool enoughMP = spell->getMPCost() <= m_PMob->health.mp || - spell->getSkillType() == SKILL_NINJUTSU || - spell->getSkillType() == SKILL_SINGING || - spell->getSkillType() == SKILL_WIND_INSTRUMENT || - spell->getSkillType() == SKILL_STRING_INSTRUMENT || - spell->getSkillType() == SKILL_GEOMANCY; - bool isNotInRecast = !m_PMob->PRecastContainer->Has(RECAST_MAGIC, static_cast(id)); + auto* spell = spell::GetSpell(id); + bool sameFamily = (family == SPELLFAMILY_NONE) ? true : spell->getSpellFamily() == family; + bool enoughMP = spell->getMPCost() <= m_PMob->health.mp || + spell->getSkillType() == SKILL_NINJUTSU || + spell->getSkillType() == SKILL_SINGING || + spell->getSkillType() == SKILL_WIND_INSTRUMENT || + spell->getSkillType() == SKILL_STRING_INSTRUMENT || + spell->getSkillType() == SKILL_GEOMANCY; + bool isNotInRecast = !m_PMob->PRecastContainer->Has(RECAST_MAGIC, static_cast(id)); if (sameFamily && enoughMP && isNotInRecast) { matches.emplace_back(id); diff --git a/src/map/navmesh/navmesh_builder.cpp b/src/map/navmesh/navmesh_builder.cpp index 70db7944a2f..b7bf6371250 100644 --- a/src/map/navmesh/navmesh_builder.cpp +++ b/src/map/navmesh/navmesh_builder.cpp @@ -89,8 +89,8 @@ NavMeshBuilder::NavMeshBuilder(const IXiMesh& xiMesh) const auto& rot = place.rotation; const auto det = rot[0] * (rot[4] * rot[8] - rot[5] * rot[7]) - - rot[3] * (rot[1] * rot[8] - rot[2] * rot[7]) + - rot[6] * (rot[1] * rot[5] - rot[2] * rot[4]); + rot[3] * (rot[1] * rot[8] - rot[2] * rot[7]) + + rot[6] * (rot[1] * rot[5] - rot[2] * rot[4]); auto ptb = PreTransformedBlock{ .worldVerts = std::vector(block.vertices.size()), diff --git a/src/map/packets/c2s/0x05e_maprect.cpp b/src/map/packets/c2s/0x05e_maprect.cpp index 174a41c92d0..de93ba049f9 100644 --- a/src/map/packets/c2s/0x05e_maprect.cpp +++ b/src/map/packets/c2s/0x05e_maprect.cpp @@ -138,10 +138,10 @@ void GP_CLI_COMMAND_MAPRECT::process(MapSession* PSession, CCharEntity* PChar) c auto destinationRegion = zoneutils::GetCurrentRegion(destinationZone); auto moghouseExitRegions = { REGION_TYPE::SANDORIA, REGION_TYPE::BASTOK, REGION_TYPE::WINDURST, REGION_TYPE::JEUNO, REGION_TYPE::WEST_AHT_URHGAN, REGION_TYPE::ADOULIN_ISLANDS }; auto moghouseSameRegion = std::ranges::any_of(moghouseExitRegions, - [&destinationRegion](const REGION_TYPE acceptedReg) - { + [&destinationRegion](const REGION_TYPE acceptedReg) + { return destinationRegion == acceptedReg; - }); + }); auto moghouseQuestComplete = PChar->profile.mhflag & (this->MyRoomExitBit ? 0x01 << (this->MyRoomExitBit - 1) : 0); if (startingRegion == REGION_TYPE::ADOULIN_ISLANDS) diff --git a/src/map/packets/s2c/0x08c_merit.cpp b/src/map/packets/s2c/0x08c_merit.cpp index 299758a38d1..f09eba9763f 100644 --- a/src/map/packets/s2c/0x08c_merit.cpp +++ b/src/map/packets/s2c/0x08c_merit.cpp @@ -73,9 +73,9 @@ GP_SERV_COMMAND_MERIT::GP_SERV_COMMAND_MERIT(const CCharEntity* PChar, const MER const Merit_t* PMerit = PChar->PMeritPoints->GetMerit(merit); packet.merits[0] = { - .index = PMerit->id, - .next = PMerit->next, - .count = PMerit->count + .index = PMerit->id, + .next = PMerit->next, + .count = PMerit->count }; // Set size for single merit update: header + count/padding + 2 merits (retail sends padding) diff --git a/src/map/utils/mobutils.cpp b/src/map/utils/mobutils.cpp index 4feef5be5ee..5470b4f99df 100644 --- a/src/map/utils/mobutils.cpp +++ b/src/map/utils/mobutils.cpp @@ -2040,11 +2040,11 @@ void WeaknessTrigger(CBaseEntity* PTarget, WeaknessType level) .actiontype = ActionCategory::MobSkillFinish, .targets = { { - .actorId = PTarget->id, - .results = { + .actorId = PTarget->id, + .results = { { - .animation = animationID, - .param = 2582, + .animation = animationID, + .param = 2582, }, }, }, diff --git a/src/map/ximesh/ximesh.cpp b/src/map/ximesh/ximesh.cpp index eb8fd1ae691..885bd5d87bc 100644 --- a/src/map/ximesh/ximesh.cpp +++ b/src/map/ximesh/ximesh.cpp @@ -470,11 +470,11 @@ auto XiMesh::query(const float x, const float y, const float z) const -> std::op { const auto& meta = block.metas[triIdx]; best = CellHit{ - .type = static_cast(meta.material), - .mapId = place.mapId, - .roofed = place.roofed, - .barrier = meta.barrier != 0, - .y = triY, + .type = static_cast(meta.material), + .mapId = place.mapId, + .roofed = place.roofed, + .barrier = meta.barrier != 0, + .y = triY, }; } } @@ -879,11 +879,11 @@ auto XiMesh::rayIntersectCellHitInfo(const Vector3& start, const Vector3& end, c { const auto& meta = block.metas[triIdx]; closestHit = RayHitInfo{ - .intersection = intersection, - .distanceSq = distanceSq, - .placement = &place, - .type = static_cast(meta.material), - .barrier = meta.barrier != 0, + .intersection = intersection, + .distanceSq = distanceSq, + .placement = &place, + .type = static_cast(meta.material), + .barrier = meta.barrier != 0, }; } } diff --git a/src/search/data_loader.cpp b/src/search/data_loader.cpp index 0f9dbafde3c..c1f0724e7c7 100644 --- a/src/search/data_loader.cpp +++ b/src/search/data_loader.cpp @@ -761,7 +761,7 @@ void CDataLoader::ExpireAHItems(uint16 expireAgeInDays) const auto cutoff = earth_time::timestamp() - static_cast(expireAgeInDays) * 86400u; const auto rset0 = db::preparedStmt("SELECT T0.id,T0.itemid,T1.stacksize, T0.stack, T0.seller FROM auction_house T0 INNER JOIN item_basic T1 ON " "T0.itemid = T1.itemid WHERE T0.buyer_name IS NULL AND T0.date <= ?", - cutoff); + cutoff); const auto expiredAuctions = rset0->rowsCount(); diff --git a/src/test/test_application.cpp b/src/test/test_application.cpp index 4b514b586ee..afa44321e08 100644 --- a/src/test/test_application.cpp +++ b/src/test/test_application.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (c) 2025 LandSandBoat Dev Teams @@ -37,53 +37,53 @@ auto appConfig() -> ApplicationConfig .serverName = "test", .arguments = { ArgumentDefinition{ - .name = "--keep-going", - .description = "Continue as much as possible after an error or failure.", - .type = ArgumentType::Flag, + .name = "--keep-going", + .description = "Continue as much as possible after an error or failure.", + .type = ArgumentType::Flag, }, ArgumentDefinition{ - .name = "--verbose", - .description = "Verbose output of errors.", - .type = ArgumentType::Flag, + .name = "--verbose", + .description = "Verbose output of errors.", + .type = ArgumentType::Flag, }, ArgumentDefinition{ - .name = "--watch", - .description = "Watch files for changes and re-run tests. (Not yet implemented)", - .type = ArgumentType::Flag, + .name = "--watch", + .description = "Watch files for changes and re-run tests. (Not yet implemented)", + .type = ArgumentType::Flag, }, ArgumentDefinition{ - .name = "--tag", - .description = "Only run tests with these #tags.", - .type = ArgumentType::Multiple, + .name = "--tag", + .description = "Only run tests with these #tags.", + .type = ArgumentType::Multiple, }, ArgumentDefinition{ - .name = "--no-tag", - .description = "Do not run tests with these #tags, takes precedence over tags.", - .type = ArgumentType::Multiple, + .name = "--no-tag", + .description = "Do not run tests with these #tags, takes precedence over tags.", + .type = ArgumentType::Multiple, }, ArgumentDefinition{ - .name = "--file", - .description = "Only run test files matching the regex pattern.", - .type = ArgumentType::Multiple, + .name = "--file", + .description = "Only run test files matching the regex pattern.", + .type = ArgumentType::Multiple, }, ArgumentDefinition{ - .name = "--no-file", - .description = "Do not run test files matching the regex pattern, takes precedence over file.", - .type = ArgumentType::Multiple, + .name = "--no-file", + .description = "Do not run test files matching the regex pattern, takes precedence over file.", + .type = ArgumentType::Multiple, }, ArgumentDefinition{ - .name = "--filter", - .description = "Only run test names matching the regex pattern.", - .type = ArgumentType::Multiple, + .name = "--filter", + .description = "Only run test names matching the regex pattern.", + .type = ArgumentType::Multiple, }, ArgumentDefinition{ - .name = "--no-filter", - .description = "Do not run test names matching the regex pattern, takes precedence over filter.", - .type = ArgumentType::Multiple, + .name = "--no-filter", + .description = "Do not run test names matching the regex pattern, takes precedence over filter.", + .type = ArgumentType::Multiple, }, ArgumentDefinition{ - .name = "--output", - .description = "Output file for test results. Use .json extension for CTRF format.", + .name = "--output", + .description = "Output file for test results. Use .json extension for CTRF format.", }, }, }; @@ -152,12 +152,12 @@ void TestApplication::run() .keepGoing = args().get("--keep-going"), .watch = args().get("--watch"), .filters = { - .includePatterns = args().get>("--file"), - .excludePatterns = args().get>("--no-file"), - .includeFilters = args().get>("--filter"), - .excludeFilters = args().get>("--no-filter"), - .includeTags = args().get>("--tag"), - .excludeTags = args().get>("--no-tag"), + .includePatterns = args().get>("--file"), + .excludePatterns = args().get>("--no-file"), + .includeFilters = args().get>("--filter"), + .excludeFilters = args().get>("--no-filter"), + .includeTags = args().get>("--tag"), + .excludeTags = args().get>("--no-tag"), }, }; diff --git a/tools/run_clang_format.py b/tools/run_clang_format.py index 9ffc078d636..557ced807fe 100755 --- a/tools/run_clang_format.py +++ b/tools/run_clang_format.py @@ -15,12 +15,12 @@ def find_clang_format(): """Find clang-format executable.""" - # Check paths for clang-format-20 only + # Check paths for clang-format-22 only paths = [ - "clang-format-20", - "/usr/bin/clang-format-20", - "/usr/local/bin/clang-format-20", - "/opt/homebrew/bin/clang-format-20", + "clang-format-22", + "/usr/bin/clang-format-22", + "/usr/local/bin/clang-format-22", + "/opt/homebrew/bin/clang-format-22", "clang-format", "/usr/bin/clang-format", "/usr/local/bin/clang-format", @@ -31,23 +31,23 @@ def find_clang_format(): executable = shutil.which(path) if "/" not in path else path if executable and os.path.isfile(executable): try: - # Verify it's exactly version 20 + # Verify it's exactly version 22 result = subprocess.run( [executable, "--version"], capture_output=True, text=True, timeout=5 ) if result.returncode == 0: - # Extract version number from output like "clang-format version 20.0.0" + # Extract version number from output like "clang-format version 22.0.0" import re version_match = re.search(r"version (\d+)\.", result.stdout) if version_match: major_version = int(version_match.group(1)) - if major_version == 20: + if major_version == 22: return executable except: continue - print("Error: clang-format version 20 not found!") + print("Error: clang-format version 22 not found!") sys.exit(1)