Fixes to entity death and event handling, plus some updates to RmGen.

This was SVN commit r3226.
This commit is contained in:
Matei
2005-12-11 02:09:11 +00:00
parent a5f9789940
commit bc23379066
16 changed files with 131 additions and 48 deletions
+17 -5
View File
@@ -153,6 +153,8 @@ void CEntity::kill()
if( m_bounds ) delete( m_bounds );
m_bounds = NULL;
m_extant = false;
m_destroyed = true;
//Shutdown(); // PT: tentatively removed - this seems to be called by ~CJSComplex, and we don't want to do it twice
@@ -520,7 +522,10 @@ void CEntity::clearOrders()
void CEntity::pushOrder( CEntityOrder& order )
{
m_orderQueue.push_back( order );
if( acceptsOrder( order.m_type, order.m_data[0].entity ) )
{
m_orderQueue.push_back( order );
}
}
bool CEntity::acceptsOrder( int orderType, CEntity* orderTarget )
@@ -1065,6 +1070,11 @@ bool CEntity::Kill( JSContext* UNUSED(cx), uintN UNUSED(argc), jsval* UNUSED(arg
// we don't fiddle with the actors or bounding information that we
// usually do when changing templates.
if(m_corpse == L"null")
{
kill();
}
CBaseEntity* corpse = g_EntityTemplateCollection.getTemplate( m_corpse );
if( corpse )
{
@@ -1072,12 +1082,14 @@ bool CEntity::Kill( JSContext* UNUSED(cx), uintN UNUSED(argc), jsval* UNUSED(arg
SetBase( m_base );
}
if( m_bounds )
{
delete( m_bounds );
m_bounds = NULL;
}
if( m_extant )
{
if( m_bounds )
delete( m_bounds );
m_bounds = NULL;
m_extant = false;
}