mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 05:39:18 +02:00
timetable ui panel enhancement, door cab control logic fix, load visualization model loading error logging tweak
This commit is contained in:
29
DynObj.cpp
29
DynObj.cpp
@@ -5769,23 +5769,28 @@ TDynamicObject::LoadMMediaFile_mdload( std::string const &Name ) const {
|
||||
TModel3d *loadmodel { nullptr };
|
||||
|
||||
// check if we don't have model override for this load type
|
||||
auto const lookup { LoadModelOverrides.find( Name ) };
|
||||
if( lookup != LoadModelOverrides.end() ) {
|
||||
loadmodel = TModelsManager::GetModel( asBaseDir + lookup->second, true );
|
||||
// if the override was succesfully loaded call it a day
|
||||
if( loadmodel != nullptr ) { return loadmodel; }
|
||||
{
|
||||
auto const lookup { LoadModelOverrides.find( Name ) };
|
||||
if( lookup != LoadModelOverrides.end() ) {
|
||||
loadmodel = TModelsManager::GetModel( asBaseDir + lookup->second, true );
|
||||
// if the override was succesfully loaded call it a day
|
||||
if( loadmodel != nullptr ) { return loadmodel; }
|
||||
}
|
||||
}
|
||||
// regular routine if there's no override or it couldn't be loaded
|
||||
// try first specialized version of the load model, vehiclename_loadname
|
||||
auto const specializedloadfilename { asBaseDir + MoverParameters->TypeName + "_" + Name };
|
||||
if( ( true == FileExists( specializedloadfilename + ".e3d" ) )
|
||||
|| ( true == FileExists( specializedloadfilename + ".t3d" ) ) ) {
|
||||
loadmodel = TModelsManager::GetModel( specializedloadfilename, true );
|
||||
{
|
||||
auto const specializedloadfilename { asBaseDir + MoverParameters->TypeName + "_" + Name };
|
||||
loadmodel = TModelsManager::GetModel( specializedloadfilename, true, false );
|
||||
if( loadmodel != nullptr ) { return loadmodel; }
|
||||
}
|
||||
if( loadmodel == nullptr ) {
|
||||
// if this fails, try generic load model
|
||||
loadmodel = TModelsManager::GetModel( asBaseDir + Name, true );
|
||||
// try generic version of the load model next, loadname
|
||||
{
|
||||
auto const genericloadfilename { asBaseDir + Name };
|
||||
loadmodel = TModelsManager::GetModel( genericloadfilename, true, false );
|
||||
if( loadmodel != nullptr ) { return loadmodel; }
|
||||
}
|
||||
// if we're still here, give up
|
||||
return loadmodel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user