diff --git a/src/graphics/sp/sp_shader_manager.cpp b/src/graphics/sp/sp_shader_manager.cpp index a5c7f9cf7..ac7ef2be9 100644 --- a/src/graphics/sp/sp_shader_manager.cpp +++ b/src/graphics/sp/sp_shader_manager.cpp @@ -32,8 +32,6 @@ #include -class AbstractKart; - namespace SP { SPShaderManager* SPShaderManager::m_spsm = NULL; @@ -66,8 +64,13 @@ SPShaderManager::SPShaderManager() }, { "dirtFactorUniformAssigner", [](SPUniformAssigner* ua) { - Camera *camera = Camera::getCamera(0); - if (camera && camera->getKart()->isOnGround()) + AbstractKart* k = NULL; + if (Camera::getNumCameras() > 1) + { + Camera* camera = Camera::getCamera(0); + k = camera->getKart(); + } + if (k && k->isOnGround()) { ua->setValue(2.0f); }