chore(Core/Misc): Some cleanup (#19970)

* remove weird blanks

* update if

* ) ) to ))

* missed some ) )

* now switch

* .
This commit is contained in:
Kitzunu
2024-09-21 19:34:31 +02:00
committed by GitHub
parent 0ba59c0053
commit 386aea03ee
157 changed files with 1606 additions and 1616 deletions

View File

@@ -1160,7 +1160,7 @@ void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket& recv_data)
ObjectGuid guid1 = getGuid(playerName1);
ObjectGuid guid2 = getGuid(playerName2);
if(!guid1 || !guid2)
if (!guid1 || !guid2)
{
SendPartyResult(PARTY_OP_SWAP, playerName1, ERR_GROUP_SWAP_FAILED);
return;

View File

@@ -319,7 +319,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
needItemDelay = GetAccountId() != rc_account;
}
if( money >= 10 * GOLD )
if (money >= 10 * GOLD)
{
CleanStringForMysqlQuery(subject);
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"{}\", NOW(), {})",
@@ -551,7 +551,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
.AddMoney(m->COD)
.SendMailTo(trans, MailReceiver(sender, m->sender), MailSender(MAIL_NORMAL, m->receiver), MAIL_CHECK_MASK_COD_PAYMENT);
if( m->COD >= 10 * GOLD )
if (m->COD >= 10 * GOLD)
{
std::string senderName;
if (!sCharacterCache->GetCharacterNameByGuid(ObjectGuid(HighGuid::Player, m->sender), senderName))

View File

@@ -1707,7 +1707,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
if (_player->IsInFlight())
return;
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
{
bf->PlayerAskToLeave(_player);
return;

View File

@@ -462,7 +462,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
spell->SendPetCastResult(SPELL_FAILED_DONT_REPORT);
if (!pet->HasSpellCooldown(spellId))
if(pet->ToPet())
if (pet->ToPet())
pet->ToPet()->RemoveSpellCooldown(spellId, true);
spell->finish(false);

View File

@@ -375,7 +375,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (mover->IsPlayer())
{
// not have spell in spellbook or spell passive and not casted by client
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()) )
if (!(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()))
{
bool allow = false;
@@ -411,7 +411,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK || spellInfo->Effects[EFFECT_0].Effect == SPELL_EFFECT_OPEN_LOCK /*allow looting from vehicle, but only if player has required spell (all necessary opening spells are in playercreateinfo_spell)*/)
if ((mover->IsCreature() && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive()) // the creature can't cast that spell, check player instead
{
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()) )
if (!(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()))
{
//cheater? kick? ban?
recvPacket.rfinish(); // prevent spam at ignore packet

View File

@@ -462,12 +462,12 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
// execute trade: 2. store
moveItems(myItems, hisItems);
if( my_trade->GetMoney() >= 10 * GOLD )
if (my_trade->GetMoney() >= 10 * GOLD )
{
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"goods\", NOW(), {})",
GetAccountId(), _player->GetGUID().GetCounter(), _player->GetName(), GetRemoteAddress(), trader->GetSession()->GetAccountId(), trader->GetName(), my_trade->GetMoney(), 6);
}
if( his_trade->GetMoney() >= 10 * GOLD )
if (his_trade->GetMoney() >= 10 * GOLD )
{
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"goods\", NOW(), {})",
trader->GetSession()->GetAccountId(), trader->GetGUID().GetCounter(), trader->GetName(), trader->GetSession()->GetRemoteAddress(), GetAccountId(), _player->GetName(), his_trade->GetMoney(), 6);