1
0
forked from 0ad/0ad

crash fix in void CEntity::UpdateXZOrientation()

This was SVN commit r6506.
This commit is contained in:
freenity 2008-11-22 18:14:51 +00:00
parent d6a55c56d7
commit 0cea78e462

View File

@ -369,6 +369,12 @@ void CEntity::UpdateXZOrientation()
m_ahead.y = cos( m_orientation.Y ); m_ahead.y = cos( m_orientation.Y );
CVector2D targetXZ = g_Game->GetWorld()->GetTerrain()->GetSlopeAngleFace(this); CVector2D targetXZ = g_Game->GetWorld()->GetTerrain()->GetSlopeAngleFace(this);
if ( !m_base )
{
return;
}
m_orientation.X = clamp( targetXZ.x, -m_base->m_anchorConformX, m_base->m_anchorConformX ); m_orientation.X = clamp( targetXZ.x, -m_base->m_anchorConformX, m_base->m_anchorConformX );
m_orientation.Z = clamp( targetXZ.y, -m_base->m_anchorConformZ, m_base->m_anchorConformZ ); m_orientation.Z = clamp( targetXZ.y, -m_base->m_anchorConformZ, m_base->m_anchorConformZ );
m_orientation_unclamped.x = targetXZ.x; m_orientation_unclamped.x = targetXZ.x;