Fix crash
This commit is contained in:
parent
33a983a701
commit
7478ed6ad4
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
class AbstractKart;
|
|
||||||
|
|
||||||
namespace SP
|
namespace SP
|
||||||
{
|
{
|
||||||
SPShaderManager* SPShaderManager::m_spsm = NULL;
|
SPShaderManager* SPShaderManager::m_spsm = NULL;
|
||||||
@ -66,8 +64,13 @@ SPShaderManager::SPShaderManager()
|
|||||||
},
|
},
|
||||||
{ "dirtFactorUniformAssigner", [](SPUniformAssigner* ua)
|
{ "dirtFactorUniformAssigner", [](SPUniformAssigner* ua)
|
||||||
{
|
{
|
||||||
Camera *camera = Camera::getCamera(0);
|
AbstractKart* k = NULL;
|
||||||
if (camera && camera->getKart()->isOnGround())
|
if (Camera::getNumCameras() > 1)
|
||||||
|
{
|
||||||
|
Camera* camera = Camera::getCamera(0);
|
||||||
|
k = camera->getKart();
|
||||||
|
}
|
||||||
|
if (k && k->isOnGround())
|
||||||
{
|
{
|
||||||
ua->setValue(2.0f);
|
ua->setValue(2.0f);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user