From bf1688421904b53639cbc7e81466a167f78ee678 Mon Sep 17 00:00:00 2001 From: theluda Date: Mon, 5 Feb 2007 09:55:59 +0000 Subject: [PATCH] [3154] - Applied MaNGOS coding style (see trunk/bcpp.cfg). Please DO NOT use DOS line feeds, use Unix line feeds! --- src/game/AggressorAI.cpp | 8 ++-- src/game/GridNotifiersImpl.h | 2 +- src/game/GuardAI.cpp | 4 +- src/game/Language.h | 1 - src/game/Level2.cpp | 4 +- src/game/Level3.cpp | 14 +++--- src/game/MotionMaster.cpp | 2 +- src/game/Player.cpp | 48 +++++++++---------- src/game/ReactorAI.cpp | 6 +-- src/game/Spell.cpp | 2 +- src/game/SpellAuras.cpp | 7 +-- src/game/Unit.cpp | 109 +++++++++++++++++++++---------------------- src/game/Unit.h | 2 - 13 files changed, 102 insertions(+), 107 deletions(-) diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index f5be2417..f189f6fd 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -73,8 +73,8 @@ AggressorAI::_needToStop() const return true; //if(!i_creature.getVictim()->isTargetableForAttack() || !i_creature.getVictim()->isInAccessablePlaceFor(&i_creature)) - //return true; - //no need for this checks because mob changes its victim only when + //return true; + //no need for this checks because mob changes its victim only when //1) victim is dead (check is in SelectHostilTarget() func) //2) victim is out of threat radius @@ -151,7 +151,7 @@ AggressorAI::UpdateAI(const uint32 diff) if( _needToStop() ) { DEBUG_LOG("Aggressor AI stoped attacking [guid=%u]", i_creature.GetGUIDLow()); - EnterEvadeMode(); // i_victimGuid == 0 && i_creature.getVictim() == NULL now + EnterEvadeMode(); // i_victimGuid == 0 && i_creature.getVictim() == NULL now return; } @@ -162,7 +162,7 @@ AggressorAI::UpdateAI(const uint32 diff) if( i_creature.isAttackReady() ) { i_creature.AttackerStateUpdate(i_creature.getVictim()); - i_creature.resetAttackTimer(); + i_creature.resetAttackTimer(); } } } diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 4ea62b99..5e51bb24 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -196,7 +196,7 @@ inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2) { if( c1->AI().IsVisible(c2) ) c1->AI().MoveInLineOfSight(c2); - + if( c2->AI().IsVisible(c1) ) c2->AI().MoveInLineOfSight(c1); } diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index c67f8d52..f947acea 100644 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -69,7 +69,7 @@ bool GuardAI::_needToStop() const /*if(!i_creature.getVictim()->isTargetableForAttack() || !i_creature.getVictim()->isInAccessablePlaceFor(&i_creature)) return true;*/ - //no need for this checks because mob changes its victim only when + //no need for this checks because mob changes its victim only when //1) victim is dead (check is in SelectHostilTarget() func) //2) victim is out of threat radius @@ -145,7 +145,7 @@ void GuardAI::UpdateAI(const uint32 diff) if( _needToStop() ) { DEBUG_LOG("Guard AI stoped attacking [guid=%u]", i_creature.GetGUIDLow()); - EnterEvadeMode(); // i_victimGuid == 0 && i_creature.getVictim() == NULL now + EnterEvadeMode(); // i_victimGuid == 0 && i_creature.getVictim() == NULL now return; } diff --git a/src/game/Language.h b/src/game/Language.h index 8368d06b..5afd4ade 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -166,7 +166,6 @@ #define LANG_INVALID_TARGET_COORD "Target map or coordinates is invalid (X: %f Y: %f MapId:%u)" - // level 3 chat #define LANG_SCRITPS_RELOADED "|cffff0000[System Message]:|rScripts reloaded" #define LANG_YOU_CHANGE_SECURITY "You change security level of %s to %i." diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index e718295c..17e52a69 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -717,7 +717,7 @@ bool ChatHandler::HandleAddMoveCommand(const char* args) { pCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); (*pCreature)->Initialize(); - if(pCreature->isAlive()) // dead creature will reset movement generator at respawn + if(pCreature->isAlive()) // dead creature will reset movement generator at respawn { pCreature->setDeathState(JUST_DIED); pCreature->Respawn(); @@ -795,7 +795,7 @@ bool ChatHandler::HandleSetMoveTypeCommand(const char* args) { pCreature->SetDefaultMovementType(move_type); (*pCreature)->Initialize(); - if(pCreature->isAlive()) // dead creature will reset movement generator at respawn + if(pCreature->isAlive()) // dead creature will reset movement generator at respawn { pCreature->setDeathState(JUST_DIED); pCreature->Respawn(); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 6d874736..8f4ea310 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -1450,7 +1450,7 @@ bool ChatHandler::HandleListItemCommand(const char* args) QueryResult *result; - // inventory case + // inventory case uint32 inv_count = 0; result=sDatabase.PQuery("SELECT COUNT(`item_template`) FROM `character_inventory` WHERE `item_template`='%u'",item_id); if(result) @@ -1460,7 +1460,7 @@ bool ChatHandler::HandleListItemCommand(const char* args) } result=sDatabase.PQuery( - // 0 1 2 3 4 5 + // 0 1 2 3 4 5 "SELECT `ci`.`item`,`cibag`.`slot` AS `bag`,`ci`.`slot`,`ci`.`guid`,`character`.`account`,`character`.`name` " "FROM `character_inventory` AS `ci` LEFT JOIN `character_inventory` AS `cibag` ON (`cibag`.`item`=`ci`.`bag`),`character` " "WHERE `ci`.`item_template`='%u' AND `ci`.`guid` = `character`.`guid` LIMIT %u ", @@ -1501,8 +1501,8 @@ bool ChatHandler::HandleListItemCommand(const char* args) else if(count) count = 0; } - - // mail case + + // mail case uint32 mail_count = 0; result=sDatabase.PQuery("SELECT COUNT(`item_template`) FROM `mail` WHERE `item_template`='%u'",item_id); if(result) @@ -1514,7 +1514,7 @@ bool ChatHandler::HandleListItemCommand(const char* args) if(count > 0) { result=sDatabase.PQuery( - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 "SELECT `mail`.`item_guid`,`mail`.`sender`,`mail`.`receiver`,`char_s`.`account`,`char_s`.`name`,`char_r`.`account`,`char_r`.`name` " "FROM `mail`,`character` as `char_s`,`character` as `char_r` " "WHERE `mail`.`item_template`='%u' AND `char_s`.`guid` = `mail`.`sender` AND `char_r`.`guid` = `mail`.`receiver` LIMIT %u", @@ -1552,7 +1552,7 @@ bool ChatHandler::HandleListItemCommand(const char* args) count = 0; } - // auction case + // auction case uint32 auc_count = 0; result=sDatabase.PQuery("SELECT COUNT(`item_template`) FROM `auctionhouse` WHERE `item_template`='%u'",item_id); if(result) @@ -1564,7 +1564,7 @@ bool ChatHandler::HandleListItemCommand(const char* args) if(count > 0) { result=sDatabase.PQuery( - // 0 1 2 3 + // 0 1 2 3 "SELECT `auctionhouse`.`itemguid`,`auctionhouse`.`itemowner`,`character`.`account`,`character`.`name` " "FROM `auctionhouse`,`character` WHERE `auctionhouse`.`item_template`='%u' AND `character`.`guid` = `auctionhouse`.`itemowner` LIMIT %u", item_id,uint32(count)); diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 8fb06b9e..b4e45408 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -40,7 +40,7 @@ MotionMaster::Initialize() if( !isStatic( curr ) ) delete curr; } - + // set new default movement generator MovementGenerator* movement = FactorySelector::selectMovementGenerator(i_owner); push( movement == NULL ? &si_idleMovement : movement ); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5a694949..3c6ef5f2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1533,27 +1533,27 @@ bool Player::isAcceptTickets() const } void Player::SetInWater(bool apply) -{ - //define player in water by opcodes - //move player's guid into HateOfflineList of those mobs - //which can't swim and move guid back into ThreatList when - //on surface. - //TODO: exist also swimming mobs, and function must be symmetric to enter/leave water - m_isInWater = apply; - - if(apply) - { - uint64 guid = GetGUID(); - InHateListOf& InHateList = GetInHateListOf(); - for(InHateListOf::iterator iter = InHateList.begin(); iter != InHateList.end(); iter++) - { - Unit* unit = (*iter); - if(isInAccessablePlaceFor(((Creature*)unit)) ) - (*iter)->MoveGuidToOfflineList(guid); - } - } - else - MoveToThreatList(); +{ + //define player in water by opcodes + //move player's guid into HateOfflineList of those mobs + //which can't swim and move guid back into ThreatList when + //on surface. + //TODO: exist also swimming mobs, and function must be symmetric to enter/leave water + m_isInWater = apply; + + if(apply) + { + uint64 guid = GetGUID(); + InHateListOf& InHateList = GetInHateListOf(); + for(InHateListOf::iterator iter = InHateList.begin(); iter != InHateList.end(); iter++) + { + Unit* unit = (*iter); + if(isInAccessablePlaceFor(((Creature*)unit)) ) + (*iter)->MoveGuidToOfflineList(guid); + } + } + else + MoveToThreatList(); } void Player::SetGameMaster(bool on) @@ -2529,7 +2529,7 @@ void Player::_SetVisibleBits(UpdateMask *updateMask, Player *target) const // item entry updateMask->SetBit(visual_base + 0); - // item enchantment IDs + // item enchantment IDs for(uint8 j = 0; j < 7; ++j) updateMask->SetBit(visual_base +1 + j); @@ -3826,7 +3826,7 @@ void Player::SendInitialReputations() for(uint32 a=0; a<64; a++) { std::list::iterator itr = FindReputationIdInTheList(a); - + if(itr != factions.end()) { data << uint8 (itr->Flags); @@ -3842,7 +3842,7 @@ void Player::SendInitialReputations() } std::list::iterator Player::FindReputationIdInTheList(uint32 faction) -{ +{ for(std::list::iterator itr = factions.begin(); itr != factions.end(); ++itr) { if(itr->ReputationListID == faction) return itr; diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp index d626bb7a..89a7e8c9 100644 --- a/src/game/ReactorAI.cpp +++ b/src/game/ReactorAI.cpp @@ -94,10 +94,10 @@ ReactorAI::UpdateAI(const uint32 time_diff) if( needToStop() ) { DEBUG_LOG("Reactor AI stoped attacking [guid=%u]", i_creature.GetGUIDLow()); - EnterEvadeMode(); // i_victimGuid == 0 && i_creature.getVictim() == NULL now + EnterEvadeMode(); // i_victimGuid == 0 && i_creature.getVictim() == NULL now return; } - + if( i_creature.IsWithinDist(i_creature.getVictim(), ATTACK_DIST)) { if( i_creature.isAttackReady() ) @@ -117,7 +117,7 @@ ReactorAI::needToStop() const /*if(!i_creature.getVictim()->isTargetableForAttack() || !i_creature.getVictim()->isInAccessablePlaceFor(&i_creature)) return true;*/ - //no need for this checks because mob changes its victim only when + //no need for this checks because mob changes its victim only when //1) victim is dead (check is in SelectHostilTarget() func) //2) victim is out of threat radius diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index c6391f08..23e0dac9 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1534,7 +1534,7 @@ void Spell::HandleThreatSpells(uint32 spellId) SpellThreatEntry const *threatSpell = sSpellThreatStore.LookupEntry(spellId); if(!threatSpell) return; - + unitTarget->AddThreat(m_caster, float(threatSpell->threat)); DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, objmgr.GetSpellRank(spellId), threatSpell->threat); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index bc58b406..4bb91e91 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1598,7 +1598,7 @@ void Aura::HandleFeignDeath(bool Apply, bool Real) m_target->AttackStop(); m_target->setDeathState(CORPSE); m_target->SetHealth(0); - + } } else @@ -1616,10 +1616,11 @@ void Aura::HandleFeignDeath(bool Apply, bool Real) data<SendMessageToSet(&data,true); */ - + } } } + void Aura::HandleAuraModStun(bool apply, bool Real) { if (apply) @@ -1839,7 +1840,7 @@ void Aura::HandleModTaunt(bool apply, bool Real) return; Unit* caster = GetCaster(); - + if(!caster || !caster->isAlive() || caster->GetTypeId() != TYPEID_PLAYER) return; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8b544838..264d073d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -328,7 +328,7 @@ void Unit::DealDamage(Unit *pVictim, uint32 damage, DamageEffectType damagetype, if (health <= damage) { - + DEBUG_LOG("DealDamage: victim just died"); DEBUG_LOG("DealDamageAttackStop"); @@ -368,9 +368,9 @@ void Unit::DealDamage(Unit *pVictim, uint32 damage, DamageEffectType damagetype, else { if(((Creature*)pVictim)->isPet()) - pVictim->DeleteInHateListOf(); - else - pVictim->DeleteThreatList(); + pVictim->DeleteInHateListOf(); + else + pVictim->DeleteThreatList(); DEBUG_LOG("DealDamageNotPlayer"); if(!((Creature*)pVictim)->isPet()) pVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); @@ -506,7 +506,6 @@ void Unit::DealDamage(Unit *pVictim, uint32 damage, DamageEffectType damagetype, SendAttackStart(pVictim); } - if(pVictim->getTransForm()) { pVictim->RemoveAurasDueToSpell(pVictim->getTransForm()); @@ -692,7 +691,6 @@ void Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, SendSpellNonMeleeDamageLog(pVictim, spellID, pdamage, spellInfo->School, absorb, resist, false, 0, crit); DealDamage(pVictim, (pdamage-absorb-resist), SPELL_DIRECT_DAMAGE, spellInfo->School, spellInfo, 0, true); - uint32 procAttacker = PROC_FLAG_HIT_SPELL; uint32 procVictim = (PROC_FLAG_STRUCK_SPELL|PROC_FLAG_TAKE_DAMAGE); @@ -1394,9 +1392,8 @@ void Unit::SendAttackStop(Unit* victim) SendMessageToSet(&data, true); sLog.outDetail("%s %u stopped attacking %s %u", (GetTypeId()==TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId()==TYPEID_PLAYER ? "player" : "creature"),victim->GetGUIDLow()); - - /*if(victim->GetTypeId() == TYPEID_UNIT) - ((Creature*)victim)->AI().EnterEvadeMode(this);*/ + /*if(victim->GetTypeId() == TYPEID_UNIT) + ((Creature*)victim)->AI().EnterEvadeMode(this);*/ } uint32 Unit::SpellMissChanceCalc(Unit *pVictim) const @@ -2558,7 +2555,6 @@ Aura* Unit::GetAura(uint32 spellId, uint32 effindex) return NULL; } - void Unit::AddItemEnchant(Item *item,uint32 enchant_id,uint8 enchant_slot,bool apply) { if (GetTypeId() != TYPEID_PLAYER) @@ -3220,7 +3216,7 @@ bool Unit::IsNeutralToAll() const bool Unit::Attack(Unit *victim) { if(!victim || victim == this) - return false; + return false; // player don't must attack in mount state if(GetTypeId()==TYPEID_PLAYER && IsMounted()) @@ -3270,7 +3266,6 @@ bool Unit::AttackStop() clearUnitState(UNIT_STAT_ATTACKING); - if(m_currentMeleeSpell) m_currentMeleeSpell->cancel(); @@ -3586,14 +3581,14 @@ bool Unit::IsDamageToThreatSpell(SpellEntry const * spellInfo) const { if(!spellInfo) return false; - + uint32 family = spellInfo->SpellFamilyName; uint32 flags = spellInfo->SpellFamilyFlags; if((family == 5 && flags == 256) || //Searing Pain - (family == 6 && flags == 8192) || //Mind Blast - (family == 11 && flags == 1048576)) //Earth Shock - return true; + (family == 6 && flags == 8192) || //Mind Blast + (family == 11 && flags == 1048576)) //Earth Shock + return true; return false; } @@ -3747,9 +3742,9 @@ bool Unit::isTargetableForAttack() int32 Unit::ModifyHealth(int32 dVal) { int32 gain = 0; - + if(dVal==0) - return 0; + return 0; int32 curHealth = (int32)GetHealth(); @@ -3772,14 +3767,14 @@ int32 Unit::ModifyHealth(int32 dVal) SetHealth(maxHealth); gain = maxHealth - curHealth; } - + return gain; } int32 Unit::ModifyPower(Powers power, int32 dVal) { int32 gain = 0; - + if(dVal==0) return 0; @@ -3794,7 +3789,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) int32 maxPower = (int32)GetMaxPower(power); - if(val < maxPower) + if(val < maxPower) { SetPower(power,val); gain = val - curPower; @@ -3804,7 +3799,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) SetPower(power,maxPower); gain = maxPower - curPower; } - + return gain; } @@ -4019,7 +4014,7 @@ float Unit::GetThreat(uint64 guid) const //use to get total threat of certain target in ThreatList ThreatList::const_iterator i; float threat = 0.0f; - + for ( i = m_threatList.begin(); i!= m_threatList.end(); i++) { if(i->UnitGuid==guid) @@ -4028,7 +4023,7 @@ float Unit::GetThreat(uint64 guid) const break; } } - + return threat; } @@ -4038,7 +4033,8 @@ void Unit::AddThreat(Unit* pVictim, float threat, uint8 school, SpellEntry const //mobs, NPCs, guards have ThreatList and HateOfflineList //players and pets have only InHateListOf //HateOfflineList is used co contain unattackable victims (in-flight, in-water, GM etc.) - if(!pVictim || (pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->isGameMaster()) ) //pVictim = player or pet + //pVictim = player or pet + if(!pVictim || (pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->isGameMaster()) ) return; if(!CanHaveThreatList()) @@ -4049,10 +4045,10 @@ void Unit::AddThreat(Unit* pVictim, float threat, uint8 school, SpellEntry const pVictim->AddToInHateList((Creature*)this); uint64 guid = pVictim->GetGUID(); - + if (pVictim->GetTypeId() == TYPEID_PLAYER && threatSpell) ((Player*)pVictim)->ApplySpellMod(threatSpell->Id, SPELLMOD_THREAT, threat); - + threat = pVictim->ApplyTotalThreatModifier(threat, school); //add attacker into ThreatList of a creature @@ -4090,20 +4086,21 @@ void Unit::AddToInHateList(Creature* attacker) if(!attacker->CanHaveThreatList()) return; - InHateListOf::iterator iter = m_inhateList.find(attacker); //add creature into InHateListOf + //add creature into InHateListOf + InHateListOf::iterator iter = m_inhateList.find(attacker); if(iter == m_inhateList.end()) { m_inhateList.insert(attacker); - SetInCombat(); //when player is in threatlist he is in combat + SetInCombat(); //when player is in threatlist he is in combat } } void Unit::ThreatAssist(Unit* target, float threat, uint8 school, SpellEntry const *threatSpell) { - if(!target) - return; + if(!target) + return; - //used to add player/pet into several ThreatLists + //used to add player/pet into several ThreatLists //of those mobs which have target in it //use for buffs and healing threat functionality InHateListOf& InHateList = target->GetInHateListOf(); @@ -4159,7 +4156,7 @@ void Unit::RemoveFromThreatList(uint64 guid) void Unit::DeleteThreatList() { - //function is used for erasing ThreatList and HateOffline lists + //function is used for erasing ThreatList and HateOffline lists //on mob deathe with removing it from players and pets //who have them in their InHateListOf lists if(!CanHaveThreatList()) @@ -4167,8 +4164,8 @@ void Unit::DeleteThreatList() if(GetTypeId()==TYPEID_UNIT) // only creatures can be in inHateListOf { - //used to clear mob's threat list - ThreatList::iterator i; + //used to clear mob's threat list + ThreatList::iterator i; for(i = m_threatList.begin(); i != m_threatList.end(); i++) { Unit* unit = ObjectAccessor::Instance().GetUnit(*this, i->UnitGuid); @@ -4192,7 +4189,7 @@ void Unit::DeleteThreatList() void Unit::DeleteInHateListOf() { - //function is used for erasing InHateListOf list + //function is used for erasing InHateListOf list //on player's or pet's deathes with removing them from mobs //who have them in their threat lists if(CanHaveThreatList()) @@ -4230,27 +4227,27 @@ bool Unit::SelectHostilTarget() if(HasAuraType(SPELL_AURA_MOD_TAUNT)) return true; - if(IsThreatListNeedsSorting()) //sort ThreatList if it is not sorted after AddThreat() + if(IsThreatListNeedsSorting()) //sort ThreatList if it is not sorted after AddThreat() { m_threatList.sort(); m_threatList.reverse(); - SortList(false); //set not to sort ThreatList until next AddThreat() call + SortList(false); //set not to sort ThreatList until next AddThreat() call } Unit* target = NULL; - float threat = m_threatList.front().Threat; + float threat = m_threatList.front().Threat; if(!getVictim() || threat > 1.1f * GetCurrentVictimThreat()) target = SelectNextVictim(); else return true; - + if(target) { SetInFront(target); ((Creature*)this)->AI().AttackStart(target); return true; } - else + else ((Creature*)this)->AI().EnterEvadeMode(); return false; @@ -4281,15 +4278,15 @@ Unit* Unit::SelectNextVictim() if(!((Creature*)this)->IsOutOfThreatArea(target) && target->isInAccessablePlaceFor( ((Creature*)this) ) ) { - if(hasVictim) //make checks on distance to victim and amount of threat - { //only until current victim values - //if(iter->UnitGuid == guid) + if(hasVictim) //make checks on distance to victim and amount of threat + { //only until current victim values + //if(iter->UnitGuid == guid) //break; if((IsWithinDistInMap(target, ATTACK_DIST) && (iter->Threat > 1.1f * threat)) || (iter->Threat > 1.3f * threat)) - { //implement 110% threat rule for targets in melee range - SetCurrentVictimThreat(iter->Threat); //and 130% rule for targets in ranged distances - return target; //for selecting alive targets + { //implement 110% threat rule for targets in melee range + SetCurrentVictimThreat(iter->Threat); //and 130% rule for targets in ranged distances + return target; //for selecting alive targets } else continue; @@ -4379,7 +4376,7 @@ float Unit::ApplyTotalThreatModifier(float threat, uint8 school) { if(!HasAuraType(SPELL_AURA_MOD_THREAT)) return threat; - + if(school >= MAX_SPELL_SCHOOOL) return threat; @@ -4395,8 +4392,8 @@ void Unit::TauntApply(Unit* taunter) if(!CanHaveThreatList()) return; - - Unit *target = getVictim(); + + Unit *target = getVictim(); if(target && target == taunter) return; @@ -4430,7 +4427,7 @@ void Unit::TauntFadeOut(Unit *taunter) if(!CanHaveThreatList()) return; - Unit *target = getVictim(); + Unit *target = getVictim(); if(!target || target != taunter) return; @@ -4439,13 +4436,13 @@ void Unit::TauntFadeOut(Unit *taunter) if(!IsHateOfflineListEmpty()) ((Creature*)this)->AI().EnterEvadeMode(); return; - } + } - if(IsThreatListNeedsSorting()) //sort ThreatList if it is not sorted after AddThreat() + if(IsThreatListNeedsSorting()) //sort ThreatList if it is not sorted after AddThreat() { m_threatList.sort(); m_threatList.reverse(); - SortList(false); //set not to sort ThreatList until next AddThreat() call + SortList(false); //set not to sort ThreatList until next AddThreat() call } float taunterThreat = GetCurrentVictimThreat(); @@ -4465,10 +4462,10 @@ void Unit::TauntFadeOut(Unit *taunter) } m_threatList.push_front(topgun); } - + if (target && target != taunter) { SetInFront(target); ((Creature*)this)->AI().AttackStart(target); - } + } } diff --git a/src/game/Unit.h b/src/game/Unit.h index 0d5459b2..55d94e97 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -700,7 +700,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject std::list *GetSingleCastAuras() { return &m_scAuras; } SpellImmuneList m_spellImmune[6]; - float GetThreat(uint64 guid) const; ThreatList& GetThreatList() { return m_threatList; } HateOfflineList& GetHateOfflineList() { return m_offlineList; } @@ -731,7 +730,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void TauntApply(Unit* pVictim); void TauntFadeOut(Unit *taunter); - Aura* GetAura(uint32 spellId, uint32 effindex); AuraMap& GetAuras( ) {return m_Auras;} AuraList& GetAurasByType(uint8 type) { return m_modAuras[type]; } -- 2.11.4.GIT