Fix crash

This commit is contained in:
Benau 2018-09-09 01:03:40 +08:00
parent 33a983a701
commit 7478ed6ad4

View File

@ -32,8 +32,6 @@
#include <algorithm>
class AbstractKart;
namespace SP
{
SPShaderManager* SPShaderManager::m_spsm = NULL;
@ -65,9 +63,14 @@ SPShaderManager::SPShaderManager()
}
},
{ "dirtFactorUniformAssigner", [](SPUniformAssigner* ua)
{
AbstractKart* k = NULL;
if (Camera::getNumCameras() > 1)
{
Camera* camera = Camera::getCamera(0);
if (camera && camera->getKart()->isOnGround())
k = camera->getKart();
}
if (k && k->isOnGround())
{
ua->setValue(2.0f);
}