mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
# Bug fixes and cleanup of entity kill code.
Put all entity cleanup code in kill(), so the JS function Kill() can just call kill(), and made the code more correct in both cases. Also fixed a bug with auras (a unit kept around auras that had been deleted). Also fixed up some notifier code that was causing crashes (although that can still happen in some cases). Fixes #176. This was SVN commit r4810.
This commit is contained in:
@@ -63,7 +63,7 @@ void CEntityFormation::SwitchBase( CFormation*& base )
|
||||
for ( std::vector<CEntity*>::iterator it=copy.begin(); it != copy.end(); it++ )
|
||||
g_FormationManager.AddUnit(*it, m_index);
|
||||
}
|
||||
bool CEntityFormation::AddUnit( CEntity*& entity )
|
||||
bool CEntityFormation::AddUnit( CEntity* entity )
|
||||
{
|
||||
debug_assert( entity );
|
||||
//Add the unit to the most appropriate slot
|
||||
@@ -89,7 +89,7 @@ bool CEntityFormation::AddUnit( CEntity*& entity )
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void CEntityFormation::RemoveUnit( CEntity*& entity )
|
||||
void CEntityFormation::RemoveUnit( CEntity* entity )
|
||||
{
|
||||
if ( !(IsValidOrder(entity->m_formationSlot) && entity) )
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user