Fixed camera crashed

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7960 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-03-17 00:12:32 +00:00
parent d272c2e725
commit 39c476ef36

View File

@ -1034,13 +1034,18 @@ void Kart::handleMaterialGFX()
// Now the kart is either falling, or driving on a terrain which
// has the 'below surface' flag set. Detect if there is a surface
// on top of the kart.
if(m_camera && material && material->hasFallingEffect() && !m_flying)
if (m_camera)
{
m_camera->setMode(Camera::CM_FALLING);
if (material && material->hasFallingEffect() && !m_flying)
{
m_camera->setMode(Camera::CM_FALLING);
}
else
{
m_camera->setMode(Camera::CM_NORMAL);
}
}
else
m_camera->setMode(Camera::CM_NORMAL);
// Use the middle of the contact points of the two rear wheels
// as the point from which to cast the ray upwards
const btWheelInfo::RaycastInfo &ri2 =