# 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:
Matei
2007-01-25 07:00:31 +00:00
parent d05a6ca78d
commit 5e7baf3a43
11 changed files with 101 additions and 97 deletions
+2 -2
View File
@@ -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;