Some Creature* casts moved to new ToCreature.

Added const Creature* ToCreature()

--HG--
branch : trunk
This commit is contained in:
raczman
2010-03-07 18:30:53 +01:00
parent 9a8f10fa30
commit 07f3b91426
29 changed files with 280 additions and 279 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ void HostilReference::updateOnlineStatus()
((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) ||
!getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT)))
{
Creature* creature = (Creature*)getSourceUnit();
Creature* creature = getSourceUnit()->ToCreature();
online = getTarget()->isInAccessiblePlaceFor(creature);
if (!online)
{
@@ -423,7 +423,7 @@ void ThreatManager::modifyThreatPercent(Unit *pVictim, int32 iPercent)
Unit* ThreatManager::getHostilTarget()
{
iThreatContainer.update();
HostilReference* nextVictim = iThreatContainer.selectNextVictim((Creature*) getOwner(), getCurrentVictim());
HostilReference* nextVictim = iThreatContainer.selectNextVictim( getOwner()->ToCreature(), getCurrentVictim());
setCurrentVictim(nextVictim);
return getCurrentVictim() != NULL ? getCurrentVictim()->getTarget() : NULL;
}