mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 19:09:20 +02:00
maintenance: null dereferencing fixes, vehicle load shadow render fix
This commit is contained in:
@@ -71,7 +71,7 @@ void TButton::Load( cParser &Parser, TDynamicObject const *Owner, TModel3d *pMod
|
||||
if( ( pModelOn == nullptr )
|
||||
&& ( pModelOff == nullptr ) ) {
|
||||
// if we failed to locate even one state submodel, cry
|
||||
ErrorLog( "Bad model: failed to locate sub-model \"" + submodelname + "\" in 3d model \"" + pModel1->NameGet() + "\"", logtype::model );
|
||||
ErrorLog( "Bad model: failed to locate sub-model \"" + submodelname + "\" in 3d model \"" + ( pModel1 != nullptr ? pModel1->NameGet() : pModel2 != nullptr ? pModel2->NameGet() : "NULL" ) + "\"", logtype::model );
|
||||
}
|
||||
|
||||
// pass submodel location to defined sounds
|
||||
|
||||
@@ -1730,7 +1730,7 @@ int TTrack::CrossSegment(int from, int into)
|
||||
|
||||
void TTrack::RaAnimListAdd(TTrack *t)
|
||||
{ // dodanie toru do listy animacyjnej
|
||||
if (SwitchExtension)
|
||||
if ((t != nullptr) && (SwitchExtension != nullptr))
|
||||
{
|
||||
if (t == this)
|
||||
return; // siebie nie dodajemy drugi raz do listy
|
||||
|
||||
@@ -2168,13 +2168,10 @@ opengl_renderer::Render( TDynamicObject *Dynamic ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( Dynamic->mdModel )
|
||||
Render( Dynamic->mdModel, Dynamic->Material(), squaredistance );
|
||||
|
||||
if( Dynamic->mdLoad ) // renderowanie nieprzezroczystego ładunku
|
||||
Render( Dynamic->mdLoad, Dynamic->Material(), squaredistance, { 0.f, Dynamic->LoadOffset, 0.f }, {} );
|
||||
|
||||
// post-render cleanup
|
||||
m_renderspecular = false;
|
||||
if( Dynamic->fShade > 0.0f ) {
|
||||
@@ -2193,7 +2190,7 @@ opengl_renderer::Render( TDynamicObject *Dynamic ) {
|
||||
if( Dynamic->mdModel )
|
||||
Render( Dynamic->mdModel, Dynamic->Material(), squaredistance );
|
||||
if( Dynamic->mdLoad ) // renderowanie nieprzezroczystego ładunku
|
||||
Render( Dynamic->mdLoad, Dynamic->Material(), squaredistance );
|
||||
Render( Dynamic->mdLoad, Dynamic->Material(), squaredistance, { 0.f, Dynamic->LoadOffset, 0.f }, {} );
|
||||
// post-render cleanup
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user