*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)

*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-17 15:35:07 -07:00
parent f21f47005d
commit 26b5e033ff
2257 changed files with 750 additions and 103852 deletions

View File

@@ -17,27 +17,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "HostilRefManager.h"
#include "ThreatManager.h"
#include "Unit.h"
#include "DBCStructure.h"
#include "SpellMgr.h"
HostilRefManager::~HostilRefManager()
{
deleteReferences();
}
//=================================================
// send threat to all my hateres for the pVictim
// The pVictim is hated than by them as well
// use for buffs and healing threat functionality
void HostilRefManager::threatAssist(Unit *pVictim, float pThreat, SpellEntry const *pThreatSpell, bool pSingleTarget)
{
HostilReference* ref;
uint32 size = pSingleTarget ? 1 : getSize(); // if pSingleTarget do not devide threat
ref = getFirst();
while(ref != NULL)
@@ -50,13 +45,10 @@ void HostilRefManager::threatAssist(Unit *pVictim, float pThreat, SpellEntry con
ref = ref->next();
}
}
//=================================================
void HostilRefManager::addThreatPercent(int32 pValue)
{
HostilReference* ref;
ref = getFirst();
while(ref != NULL)
{
@@ -64,14 +56,11 @@ void HostilRefManager::addThreatPercent(int32 pValue)
ref = ref->next();
}
}
//=================================================
// The online / offline status is given to the method. The calculation has to be done before
void HostilRefManager::setOnlineOfflineState(bool pIsOnline)
{
HostilReference* ref;
ref = getFirst();
while(ref != NULL)
{
@@ -79,10 +68,8 @@ void HostilRefManager::setOnlineOfflineState(bool pIsOnline)
ref = ref->next();
}
}
//=================================================
// The online / offline status is calculated and set
void HostilRefManager::updateThreatTables()
{
HostilReference* ref = getFirst();
@@ -92,11 +79,9 @@ void HostilRefManager::updateThreatTables()
ref = ref->next();
}
}
//=================================================
// The references are not needed anymore
// tell the source to remove them from the list and free the mem
void HostilRefManager::deleteReferences()
{
HostilReference* ref = getFirst();
@@ -108,10 +93,8 @@ void HostilRefManager::deleteReferences()
ref = nextRef;
}
}
//=================================================
// delete one reference, defined by Unit
void HostilRefManager::deleteReference(Unit *pCreature)
{
HostilReference* ref = getFirst();
@@ -127,10 +110,8 @@ void HostilRefManager::deleteReference(Unit *pCreature)
ref = nextRef;
}
}
//=================================================
// set state for one reference, defined by Unit
void HostilRefManager::setOnlineOfflineState(Unit *pCreature,bool pIsOnline)
{
HostilReference* ref = getFirst();
@@ -145,6 +126,5 @@ void HostilRefManager::setOnlineOfflineState(Unit *pCreature,bool pIsOnline)
ref = nextRef;
}
}
//=================================================