aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp195
1 files changed, 93 insertions, 102 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index a110f64dc5a..0e7af6e9f83 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -855,9 +855,9 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen)
{
- if (MaxValue == DISABLED_MIRROR_TIMER)
+ if (int(MaxValue) == DISABLED_MIRROR_TIMER)
{
- if (CurrentValue!=DISABLED_MIRROR_TIMER)
+ if (int(CurrentValue) != DISABLED_MIRROR_TIMER)
StopMirrorTimer(Type);
return;
}
@@ -1580,7 +1580,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
if(!enchantId)
continue;
- if(enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId))
+ if ((enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)))
break;
}
@@ -2400,9 +2400,9 @@ bool Player::IsGroupVisibleFor(Player* p) const
bool Player::IsInSameGroupWith(Player const* p) const
{
- return p==this || GetGroup() != NULL &&
+ return (p==this || (GetGroup() != NULL &&
GetGroup() == p->GetGroup() &&
- GetGroup()->SameSubGroup((Player*)this, (Player*)p);
+ GetGroup()->SameSubGroup((Player*)this, (Player*)p)));
}
///- If the player is invited, remove him. If the group if then only 1 person, disband the group.
@@ -3284,7 +3284,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
- (pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 )
+ ((pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0))
{
switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0))
{
@@ -3365,7 +3365,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
{
// note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell
// talent dependent passives activated at form apply have proper stance data
- bool need_cast = !spellInfo->Stances || m_form != 0 && (spellInfo->Stances & (1<<(m_form-1)));
+ bool need_cast = (!spellInfo->Stances || (m_form != 0 && (spellInfo->Stances & (1<<(m_form-1)))));
//Check CasterAuraStates
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState)));
@@ -3407,7 +3407,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
if (itr == m_spells.end())
return;
- if(itr->second->state == PLAYERSPELL_REMOVED || disabled && itr->second->disabled || itr->second->state == PLAYERSPELL_TEMPORARY)
+ if (itr->second->state == PLAYERSPELL_REMOVED || (disabled && itr->second->disabled) || itr->second->state == PLAYERSPELL_TEMPORARY)
return;
// unlearn non talent higher ranks (recursive)
@@ -3524,7 +3524,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL &&
pSkill->categoryId != SKILL_CATEGORY_CLASS ||// not unlearn class skills (spellbook/talent pages)
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
- (pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 )
+ ((pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0))
{
// not reset skills for professions and racial abilities
if ((pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
@@ -4771,7 +4771,7 @@ void Player::RepopAtGraveyard()
AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId());
// Such zones are considered unreachable as a ghost and the player must be automatically revived
- if(!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY || GetTransport() || GetPositionZ() < -500.0f)
+ if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < -500.0f)
{
ResurrectPlayer(0.5f);
SpawnCorpseBones();
@@ -7094,7 +7094,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
// If set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage
if (ssv)
{
- if (extraDPS = ssv->getDPSMod(proto->ScalingStatValue))
+ if ((extraDPS = ssv->getDPSMod(proto->ScalingStatValue)))
{
float average = extraDPS * proto->Delay / 1000.0f;
minDamage = 0.7f * average;
@@ -9012,10 +9012,10 @@ Item* Player::GetItemByPos( uint16 pos ) const
Item* Player::GetItemByPos( uint8 bag, uint8 slot ) const
{
- if( bag == INVENTORY_SLOT_BAG_0 && ( slot < BANK_SLOT_BAG_END || slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END ) )
+ if( bag == INVENTORY_SLOT_BAG_0 && ( slot < BANK_SLOT_BAG_END || (slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END )) )
return m_items[slot];
- else if(bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END
- || bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END )
+ else if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)
+ || (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END) )
{
Bag *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag );
if ( pBag )
@@ -11664,7 +11664,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
if(IsEquipmentPos ( src ) || IsBagPos ( src ))
{
// bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
- uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty());
+ uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || (pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty()));
if(msg != EQUIP_ERR_OK)
{
SendEquipError( msg, pSrcItem, pDstItem );
@@ -11694,7 +11694,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
if(IsEquipmentPos ( dst ) || IsBagPos ( dst ))
{
// bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
- uint8 msg = CanUnequipItem( dst, !IsBagPos ( dst ) || IsBagPos ( src ) || pSrcItem->IsBag() && ((Bag*)pSrcItem)->IsEmpty());
+ uint8 msg = CanUnequipItem( dst, !IsBagPos ( dst ) || IsBagPos ( src ) || (pSrcItem->IsBag() && ((Bag*)pSrcItem)->IsEmpty()));
if(msg != EQUIP_ERR_OK)
{
SendEquipError( msg, pSrcItem, pDstItem );
@@ -11914,19 +11914,19 @@ void Player::SwapItem( uint16 src, uint16 dst )
RemoveItem(srcbag, srcslot, false);
// add to dest
- if( IsInventoryPos( dst ) )
+ if (IsInventoryPos(dst))
StoreItem(sDest, pSrcItem, true);
- else if( IsBankPos( dst ) )
+ else if (IsBankPos(dst))
BankItem(sDest, pSrcItem, true);
- else if( IsEquipmentPos( dst ) )
+ else if (IsEquipmentPos(dst))
EquipItem(eDest, pSrcItem, true);
// add to src
- if( IsInventoryPos( src ) )
+ if (IsInventoryPos(src))
StoreItem(sDest2, pDstItem, true);
- else if( IsBankPos( src ) )
+ else if (IsBankPos(src))
BankItem(sDest2, pDstItem, true);
- else if( IsEquipmentPos( src ) )
+ else if (IsEquipmentPos(src))
EquipItem(eDest2, pDstItem, true);
AutoUnequipOffhandIfNeed();
@@ -11934,11 +11934,11 @@ void Player::SwapItem( uint16 src, uint16 dst )
void Player::AddItemToBuyBackSlot( Item *pItem )
{
- if( pItem )
+ if (pItem)
{
uint32 slot = m_currentBuybackSlot;
// if current back slot non-empty search oldest or free
- if(m_items[slot])
+ if (m_items[slot])
{
uint32 oldest_time = GetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 );
uint32 oldest_slot = BUYBACK_SLOT_START;
@@ -11946,7 +11946,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
for(uint32 i = BUYBACK_SLOT_START+1; i < BUYBACK_SLOT_END; ++i )
{
// found empty
- if(!m_items[i])
+ if (!m_items[i])
{
slot = i;
break;
@@ -11954,7 +11954,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
uint32 i_time = GetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + i - BUYBACK_SLOT_START);
- if(oldest_time > i_time)
+ if (oldest_time > i_time)
{
oldest_time = i_time;
oldest_slot = i;
@@ -11974,15 +11974,14 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
uint32 eslot = slot - BUYBACK_SLOT_START;
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
- ItemPrototype const *pProto = pItem->GetProto();
- if( pProto )
+ if (ItemPrototype const *pProto = pItem->GetProto())
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
else
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime );
// move to next (for non filled list is move most optimized choice)
- if(m_currentBuybackSlot < BUYBACK_SLOT_END - 1)
+ if (m_currentBuybackSlot < BUYBACK_SLOT_END - 1)
++m_currentBuybackSlot;
}
}
@@ -11990,7 +11989,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
Item* Player::GetItemFromBuyBackSlot( uint32 slot )
{
sLog.outDebug( "STORAGE: GetItemFromBuyBackSlot slot = %u", slot);
- if( slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END )
+ if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END)
return m_items[slot];
return NULL;
}
@@ -11998,10 +11997,10 @@ Item* Player::GetItemFromBuyBackSlot( uint32 slot )
void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
{
sLog.outDebug( "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot);
- if( slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END )
+ if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END)
{
Item *pItem = m_items[slot];
- if( pItem )
+ if (pItem)
{
pItem->RemoveFromWorld();
if(del) pItem->SetState(ITEM_REMOVED, this);
@@ -12023,21 +12022,21 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 )
{
sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
- WorldPacket data( SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18) );
+ WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18));
data << uint8(msg);
- if(msg)
+ if (msg != EQUIP_ERR_OK)
{
data << uint64(pItem ? pItem->GetGUID() : 0);
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
data << uint8(0); // not 0 there...
- if(msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I)
+ if (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I)
{
uint32 level = 0;
- if(pItem)
- if(ItemPrototype const* proto = pItem->GetProto())
+ if (pItem)
+ if (ItemPrototype const* proto = pItem->GetProto())
level = proto->RequiredLevel;
data << uint32(level); // new 2.4.0
@@ -12052,7 +12051,7 @@ void Player::SendBuyError( uint8 msg, Creature* pCreature, uint32 item, uint32 p
WorldPacket data( SMSG_BUY_FAILED, (8+4+4+1) );
data << uint64(pCreature ? pCreature->GetGUID() : 0);
data << uint32(item);
- if( param > 0 )
+ if (param > 0)
data << uint32(param);
data << uint8(msg);
GetSession()->SendPacket(&data);
@@ -12064,7 +12063,7 @@ void Player::SendSellError( uint8 msg, Creature* pCreature, uint64 guid, uint32
WorldPacket data( SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10
data << uint64(pCreature ? pCreature->GetGUID() : 0);
data << uint64(guid);
- if( param > 0 )
+ if (param > 0)
data << uint32(param);
data << uint8(msg);
GetSession()->SendPacket(&data);
@@ -12080,15 +12079,15 @@ void Player::ClearTrade()
void Player::TradeCancel(bool sendback)
{
- if(pTrader)
+ if (pTrader)
{
// send yellow "Trade canceled" message to both traders
WorldSession* ws;
ws = GetSession();
- if(sendback)
+ if (sendback)
ws->SendCancelTrade();
ws = pTrader->GetSession();
- if(!ws->PlayerLogout())
+ if (!ws->PlayerLogout())
ws->SendCancelTrade();
// cleanup
@@ -12102,7 +12101,7 @@ void Player::TradeCancel(bool sendback)
void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
{
- if(m_itemDuration.empty())
+ if (m_itemDuration.empty())
return;
sLog.outDebug("Player::UpdateItemDuration(%u,%u)", time, realtimeonly);
@@ -12112,7 +12111,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
Item* item = *itr;
++itr; // current element can be erased in UpdateDuration
- if (realtimeonly && item->GetProto()->Duration < 0 || !realtimeonly)
+ if ((realtimeonly && item->GetProto()->Duration < 0) || !realtimeonly)
item->UpdateDuration(this,time);
}
}
@@ -12123,17 +12122,17 @@ void Player::UpdateEnchantTime(uint32 time)
{
assert(itr->item);
next = itr;
- if(!itr->item->GetEnchantmentId(itr->slot))
+ if (!itr->item->GetEnchantmentId(itr->slot))
{
next = m_enchantDuration.erase(itr);
}
- else if(itr->leftduration <= time)
+ else if (itr->leftduration <= time)
{
ApplyEnchantment(itr->item, itr->slot, false, false);
itr->item->ClearEnchantment(itr->slot);
next = m_enchantDuration.erase(itr);
}
- else if(itr->leftduration > time)
+ else if (itr->leftduration > time)
{
itr->leftduration -= time;
++next;
@@ -12145,11 +12144,11 @@ void Player::AddEnchantmentDurations(Item *item)
{
for(int x = 0; x < MAX_ENCHANTMENT_SLOT; ++x)
{
- if(!item->GetEnchantmentId(EnchantmentSlot(x)))
+ if (!item->GetEnchantmentId(EnchantmentSlot(x)))
continue;
uint32 duration = item->GetEnchantmentDuration(EnchantmentSlot(x));
- if( duration > 0 )
+ if (duration > 0)
AddEnchantmentDuration(item, EnchantmentSlot(x), duration);
}
}
@@ -12158,7 +12157,7 @@ void Player::RemoveEnchantmentDurations(Item *item)
{
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end();)
{
- if(itr->item == item)
+ if (itr->item == item)
{
// save duration in item
item->SetEnchantmentDuration(EnchantmentSlot(itr->slot), itr->leftduration);
@@ -12175,9 +12174,9 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot)
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(), next; itr != m_enchantDuration.end(); itr = next)
{
next = itr;
- if(itr->slot == slot)
+ if (itr->slot == slot)
{
- if(itr->item && itr->item->GetEnchantmentId(slot))
+ if (itr->item && itr->item->GetEnchantmentId(slot))
{
// Poisons and DK runes are enchants which are allowed on arenas
if (spellmgr.IsArenaAllowedEnchancment(itr->item->GetEnchantmentId(slot)))
@@ -12200,48 +12199,39 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot)
// remove enchants from inventory items
// NOTE: no need to remove these from stats, since these aren't equipped
// in inventory
- for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
- {
- Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetEnchantmentId(slot) )
- pItem->ClearEnchantment(slot);
- }
+ for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
+ if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
+ if (pItem->GetEnchantmentId(slot))
+ pItem->ClearEnchantment(slot);
// in inventory bags
- for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
- {
- Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pBag )
- {
+ for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
+ if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
- {
- Item* pItem = pBag->GetItemByPos(j);
- if( pItem && pItem->GetEnchantmentId(slot) )
- pItem->ClearEnchantment(slot);
- }
- }
- }
+ if (Item* pItem = pBag->GetItemByPos(j))
+ if (pItem->GetEnchantmentId(slot))
+ pItem->ClearEnchantment(slot);
}
// duration == 0 will remove item enchant
void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration)
{
- if(!item)
+ if (!item)
return;
- if(slot >= MAX_ENCHANTMENT_SLOT)
+ if (slot >= MAX_ENCHANTMENT_SLOT)
return;
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end(); ++itr)
{
- if(itr->item == item && itr->slot == slot)
+ if (itr->item == item && itr->slot == slot)
{
itr->item->SetEnchantmentDuration(itr->slot, itr->leftduration);
m_enchantDuration.erase(itr);
break;
}
}
- if(item && duration > 0 )
+ if (item && duration > 0 )
{
GetSession()->SendItemEnchantTimeUpdate(GetGUID(), item->GetGUID(), slot, uint32(duration/1000));
m_enchantDuration.push_back(EnchantDuration(item, slot, duration));
@@ -12256,24 +12246,24 @@ void Player::ApplyEnchantment(Item *item,bool apply)
void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition)
{
- if(!item)
+ if (!item)
return;
- if(!item->IsEquipped())
+ if (!item->IsEquipped())
return;
- if(slot >= MAX_ENCHANTMENT_SLOT)
+ if (slot >= MAX_ENCHANTMENT_SLOT)
return;
uint32 enchant_id = item->GetEnchantmentId(slot);
- if(!enchant_id)
+ if (!enchant_id)
return;
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
- if(!pEnchant)
+ if (!pEnchant)
return;
- if(!ignore_condition && pEnchant->EnchantmentCondition && !((Player*)this)->EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
+ if (!ignore_condition && pEnchant->EnchantmentCondition && !((Player*)this)->EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
return;
if (!item->IsBroken())
@@ -12300,9 +12290,9 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
break;
case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL:
- if(enchant_spell_id)
+ if (enchant_spell_id)
{
- if(apply)
+ if (apply)
{
int32 basepoints = 0;
// Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
@@ -12708,34 +12698,35 @@ void Player::PrepareQuestMenu( uint64 guid )
}
}
-void Player::SendPreparedQuest( uint64 guid )
+void Player::SendPreparedQuest(uint64 guid)
{
QuestMenu& questMenu = PlayerTalkClass->GetQuestMenu();
- if( questMenu.Empty() )
+ if (questMenu.Empty())
return;
- QuestMenuItem const& qmi0 = questMenu.GetItem( 0 );
+ QuestMenuItem const& qmi0 = questMenu.GetItem(0);
uint32 status = qmi0.m_qIcon;
// single element case
- if ( questMenu.MenuItemCount() == 1 )
+ if (questMenu.MenuItemCount() == 1)
{
// Auto open -- maybe also should verify there is no greeting
uint32 quest_id = qmi0.m_qId;
Quest const* pQuest = objmgr.GetQuestTemplate(quest_id);
- if ( pQuest )
+ if (pQuest)
{
- if( status == DIALOG_STATUS_UNK2 && !GetQuestRewardStatus( quest_id ) )
- PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanRewardQuest(pQuest, false), true );
- else if( status == DIALOG_STATUS_UNK2 )
- PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanRewardQuest(pQuest, false), true );
- // Send completable on repeatable quest if player don't have quest
- else if( pQuest->IsRepeatable() && !pQuest->IsDaily() )
- PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanCompleteRepeatableQuest(pQuest), true );
+ if (status == DIALOG_STATUS_UNK2 && !GetQuestRewardStatus(quest_id))
+ PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, CanRewardQuest(pQuest, false), true);
+ else if (status == DIALOG_STATUS_UNK2)
+ PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, CanRewardQuest(pQuest, false), true);
+ // Send completable on repeatable and autoCompletable quest if player don't have quest
+ // TODO: verify if check for !pQuest->IsDaily() is really correct (possibly not)
+ else if (pQuest->IsAutoComplete() && pQuest->IsRepeatable() && !pQuest->IsDaily())
+ PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, CanCompleteRepeatableQuest(pQuest), true);
else
- PlayerTalkClass->SendQuestGiverQuestDetails( pQuest, guid, true );
+ PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, guid, true);
}
}
// multiply entries
@@ -12748,11 +12739,11 @@ void Player::SendPreparedQuest( uint64 guid )
// need pet case for some quests
Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid);
- if( pCreature )
+ if (pCreature)
{
uint32 textid = pCreature->GetNpcTextId();
GossipText const* gossiptext = objmgr.GetGossipText(textid);
- if( !gossiptext )
+ if (!gossiptext)
{
qe._Delay = 0; //TEXTEMOTE_MESSAGE; //zyg: player emote
qe._Emote = 0; //TEXTEMOTE_HELLO; //zyg: NPC emote
@@ -12794,7 +12785,7 @@ void Player::SendPreparedQuest( uint64 guid )
}
}
}
- PlayerTalkClass->SendQuestGiverQuestList( qe, title, guid );
+ PlayerTalkClass->SendQuestGiverQuestList(qe, title, guid);
}
}
@@ -14750,7 +14741,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// check name limitations
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
- GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name))
+ (GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name)))
{
delete result;
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid);
@@ -17934,7 +17925,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
uint32 mount_display_id = objmgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL);
// in spell case allow 0 model
- if (mount_display_id == 0 && spellid == 0 || sourcepath == 0)
+ if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0)
{
WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR);
@@ -20395,8 +20386,8 @@ void Player::UpdateCorpseReclaimDelay()
{
bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
- if( pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) ||
- !pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
+ if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
+ (!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
return;
time_t now = time(NULL);