mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
#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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user