#Unit AI: Aggressive, defensive and stand ground stances.

Also split Entity.cpp further, moving the rendering code to
EntityRendering.cpp and the JS interface code to
EntityScriptInterface.cpp. This makes each individual file smaller
(about 1000 lines still!) and lets them be compiled independently.

This was SVN commit r4314.
This commit is contained in:
Matei
2006-09-09 00:00:23 +00:00
parent aceaee324b
commit aa50820d9a
14 changed files with 1919 additions and 1391 deletions
+6 -1
View File
@@ -190,7 +190,7 @@ void CEntityManager::GetInRange( float x, float z, float radius, std::vector<CEn
CEntity* e = vec[i];
float dx = x - e->m_position.X;
float dz = z - e->m_position.Z;
if(dx*dx + dz*dz <= radiusSq)
if( dx*dx + dz*dz <= radiusSq )
{
results.push_back( e );
}
@@ -199,6 +199,11 @@ void CEntityManager::GetInRange( float x, float z, float radius, std::vector<CEn
}
}
void CEntityManager::GetInLOS( CEntity* entity, std::vector<CEntity*>& results )
{
GetInRange( entity->m_position.X, entity->m_position.Z, entity->m_los*CELL_SIZE, results );
}
/*
void CEntityManager::dispatchAll( CMessage* msg )
{