*Try to fix the bug that creature does not regenerate after evade.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-09-02 12:46:26 -05:00
parent c150629f8d
commit 8efb15c52a
6 changed files with 9 additions and 17 deletions
+3 -9
View File
@@ -44,25 +44,19 @@ inline void PlayerCreatureRelocationWorker(Player* pl, Creature* c)
// Creature AI reaction
if(c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS))
{
if( c->IsAIEnabled && c->_IsWithinDist(pl, c->m_SightDistance, true) && !c->IsInEvadeMode() )
if(c->_IsWithinDist(pl, c->m_SightDistance, true) && c->IsAIEnabled)
c->AI()->MoveInLineOfSight(pl);
}
}
inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2)
{
if(c1->HasReactState(REACT_AGGRESSIVE) && !c1->hasUnitState(UNIT_STAT_SIGHTLESS))
{
if( c1->IsAIEnabled && c1->_IsWithinDist(c2, c1->m_SightDistance, true) && !c1->IsInEvadeMode() )
if(c1->_IsWithinDist(c2, c1->m_SightDistance, true) && c1->IsAIEnabled)
c1->AI()->MoveInLineOfSight(c2);
}
if(c2->HasReactState(REACT_AGGRESSIVE) && !c2->hasUnitState(UNIT_STAT_SIGHTLESS))
{
if( c2->IsAIEnabled && c1->_IsWithinDist(c2, c2->m_SightDistance, true) && !c2->IsInEvadeMode() )
if(c1->_IsWithinDist(c2, c2->m_SightDistance, true) && c2->IsAIEnabled)
c2->AI()->MoveInLineOfSight(c1);
}
}
template<class T>