diff --git a/source/simulation/BaseEntityCollection.cpp b/source/simulation/BaseEntityCollection.cpp index 0d8364a4e0..626b03a321 100755 --- a/source/simulation/BaseEntityCollection.cpp +++ b/source/simulation/BaseEntityCollection.cpp @@ -29,7 +29,6 @@ void CBaseEntityCollection::loadTemplates() // He's so annoyingly slow... CBaseEntity* dude = getTemplate( "Prometheus Dude" ); - dude->m_actorObject->m_WalkAnim->m_FrameTime /= 10.0f; dude->m_speed *= 10.0f; /* diff --git a/source/simulation/Entity.cpp b/source/simulation/Entity.cpp index f7b77a0ea5..7697da1fac 100755 --- a/source/simulation/Entity.cpp +++ b/source/simulation/Entity.cpp @@ -15,10 +15,7 @@ CEntity::CEntity( CBaseEntity* base, CVector3D position, float orientation ) // Set our parent unit and build us an actor. m_base = base; - m_actor = new CUnit; - - m_actor->m_Object = m_base->m_actorObject; - m_actor->m_Model = ( m_actor->m_Object->m_Model ) ? m_actor->m_Object->m_Model->Clone() : NULL; + m_actor = new CUnit(m_base->m_actorObject,m_base->m_actorObject->m_Model->Clone()); // Register the actor with the renderer. @@ -58,7 +55,6 @@ CEntity::~CEntity() { if( m_actor ) { - if( m_actor->m_Model ) delete( m_actor->m_Model ); g_UnitMan.RemoveUnit( m_actor ); delete( m_actor ); } @@ -79,17 +75,13 @@ void CEntity::updateActorTransforms() m._31 = m_ahead.x; m._32 = 0.0f; m._33 = -m_ahead.y; m._34 = m_position.Z; m._41 = 0.0f; m._42 = 0.0f; m._43 = 0.0f; m._44 = 1.0f; - /* Equivalent to: - - m.SetYRotation( m_orientation ); - - m.Translate( m_position ); - - But the matrix multiplication seemed such a waste when we already have a forward vector - + /* Equivalent to: + m.SetYRotation( m_orientation ); + m.Translate( m_position ); + But the matrix multiplication seemed such a waste when we already have a forward vector */ - m_actor->m_Model->SetTransform( m ); + m_actor->GetModel()->SetTransform( m ); } float CEntity::getExactGroundLevel( float x, float y ) @@ -161,8 +153,8 @@ void CEntity::update( float timestep ) assert( 0 && "Invalid entity order" ); } } - if( m_actor->m_Model->GetAnimation() != m_actor->m_Object->m_IdleAnim ) - m_actor->m_Model->SetAnimation( m_actor->m_Object->m_IdleAnim ); + if( m_actor->GetModel()->GetAnimation() != m_actor->GetObject()->m_IdleAnim ) + m_actor->GetModel()->SetAnimation( m_actor->GetObject()->m_IdleAnim ); } void CEntity::dispatch( CMessage* msg ) diff --git a/source/simulation/EntityStateProcessing.cpp b/source/simulation/EntityStateProcessing.cpp index c25518c02a..aff7b31d65 100755 --- a/source/simulation/EntityStateProcessing.cpp +++ b/source/simulation/EntityStateProcessing.cpp @@ -115,10 +115,10 @@ bool CEntity::processGoto( CEntityOrder* current, float timestep ) { CVector2D path_to = current->m_data[0].location; m_orderQueue.pop_front(); - if( m_actor->m_Model->GetAnimation() != m_actor->m_Object->m_WalkAnim ) + if( m_actor->GetModel()->GetAnimation() != m_actor->GetObject()->m_WalkAnim ) { - m_actor->m_Model->SetAnimation( m_actor->m_Object->m_WalkAnim ); - m_actor->m_Model->Update( ( rand() * 1000.0f ) / 1000.0f ); + m_actor->GetModel()->SetAnimation( m_actor->GetObject()->m_WalkAnim ); + m_actor->GetModel()->Update( ( rand() * 1000.0f ) / 1000.0f ); } g_Pathfinder.requestPath( me, path_to ); return( true );