refactor(Core): Improve readability (#22691)

This commit is contained in:
天鹭
2025-08-19 21:03:03 +08:00
committed by GitHub
parent a19dc17cc5
commit 2602add0fd
6 changed files with 8 additions and 8 deletions

View File

@@ -895,7 +895,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
go->SetLootState(GO_READY); go->SetLootState(GO_READY);
} }
go->UseDoorOrButton(0, !!e.action.activateObject.alternative, unit); go->UseDoorOrButton(0, e.action.activateObject.alternative, unit);
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated", go->GetGUID().ToString()); LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated", go->GetGUID().ToString());
} }
} }
@@ -1485,14 +1485,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{ {
for (WorldObject* target : targets) for (WorldObject* target : targets)
if (IsUnit(target)) if (IsUnit(target))
target->ToUnit()->SetVisible(!!e.action.visibility.state); target->ToUnit()->SetVisible(e.action.visibility.state);
break; break;
} }
case SMART_ACTION_SET_ACTIVE: case SMART_ACTION_SET_ACTIVE:
{ {
for (WorldObject* target : targets) for (WorldObject* target : targets)
target->setActive(!!e.action.setActive.state); target->setActive(e.action.setActive.state);
break; break;
} }
case SMART_ACTION_ATTACK_START: case SMART_ACTION_ATTACK_START:

View File

@@ -488,7 +488,7 @@ void AuctionHouseObject::AddAuction(AuctionEntry* auction)
bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction) bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction)
{ {
bool wasInMap = !!_auctionsMap.erase(auction->Id); bool wasInMap = _auctionsMap.erase(auction->Id);
sAuctionMgr->GetAuctionHouseSearcher()->RemoveAuction(auction); sAuctionMgr->GetAuctionHouseSearcher()->RemoveAuction(auction);
sScriptMgr->OnAuctionRemove(this, auction); sScriptMgr->OnAuctionRemove(this, auction);

View File

@@ -206,7 +206,7 @@ bool Acore::Hyperlinks::LinkTags::spell::StoreTo(SpellInfo const*& val, std::str
if (!(t.TryConsumeTo(spellId) && t.IsEmpty())) if (!(t.TryConsumeTo(spellId) && t.IsEmpty()))
return false; return false;
return !!(val = sSpellMgr->GetSpellInfo(spellId)); return (val = sSpellMgr->GetSpellInfo(spellId));
} }
bool Acore::Hyperlinks::LinkTags::talent::StoreTo(TalentLinkData& val, std::string_view text) bool Acore::Hyperlinks::LinkTags::talent::StoreTo(TalentLinkData& val, std::string_view text)

View File

@@ -68,7 +68,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
{ {
// don't allow 0 items (it's checked during table load) // don't allow 0 items (it's checked during table load)
ASSERT(ConditionValue2); ASSERT(ConditionValue2);
bool checkBank = !!ConditionValue3; bool checkBank = ConditionValue3;
condMeets = player->HasItemCount(ConditionValue1, ConditionValue2, checkBank); condMeets = player->HasItemCount(ConditionValue1, ConditionValue2, checkBank);
} }
} }

View File

@@ -67,7 +67,7 @@ struct FormationInfo
uint32 point_1; uint32 point_1;
uint32 point_2; uint32 point_2;
bool HasGroupFlag(uint16 flag) const { return !!(groupAI & flag); } bool HasGroupFlag(uint16 flag) const { return (groupAI & flag); }
}; };
typedef std::unordered_map<ObjectGuid::LowType/*memberDBGUID*/, FormationInfo /*formationInfo*/> CreatureGroupInfoType; typedef std::unordered_map<ObjectGuid::LowType/*memberDBGUID*/, FormationInfo /*formationInfo*/> CreatureGroupInfoType;

View File

@@ -1692,7 +1692,7 @@ public:
bool RemoveMItem(ObjectGuid::LowType itemLowGuid) bool RemoveMItem(ObjectGuid::LowType itemLowGuid)
{ {
return !!mMitems.erase(itemLowGuid); return mMitems.erase(itemLowGuid);
} }
void PetSpellInitialize(); void PetSpellInitialize();