mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 04:19:19 +02:00
door operation permit preset cab control, door control system enhancements, minor bug fixes
This commit is contained in:
20
DynObj.cpp
20
DynObj.cpp
@@ -2287,18 +2287,19 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
|
||||
int
|
||||
TDynamicObject::init_sections( TModel3d const *Model, std::string const &Nameprefix ) {
|
||||
|
||||
std::string sectionname;
|
||||
auto sectioncount = 0;
|
||||
auto sectionindex = 0;
|
||||
TSubModel *sectionsubmodel { nullptr };
|
||||
|
||||
do {
|
||||
sectionname =
|
||||
Nameprefix + (
|
||||
sectionindex < 10 ?
|
||||
"0" + std::to_string( sectionindex ) :
|
||||
std::to_string( sectionindex ) );
|
||||
sectionsubmodel = Model->GetFromName( sectionname );
|
||||
// section names for index < 10 match either prefix0X or prefixX
|
||||
// section names above 10 match prefixX
|
||||
auto const sectionindexname { std::to_string( sectionindex ) };
|
||||
sectionsubmodel = Model->GetFromName( Nameprefix + sectionindexname );
|
||||
if( ( sectionsubmodel == nullptr )
|
||||
&& ( sectionindex < 10 ) ) {
|
||||
sectionsubmodel = Model->GetFromName( Nameprefix + "0" + sectionindexname );
|
||||
}
|
||||
if( sectionsubmodel != nullptr ) {
|
||||
Sections.push_back( {
|
||||
sectionsubmodel,
|
||||
@@ -2771,10 +2772,7 @@ TDynamicObject::update_load_sections() {
|
||||
|
||||
for( auto §ion : Sections ) {
|
||||
|
||||
section.load = (
|
||||
mdLoad != nullptr ?
|
||||
mdLoad->GetFromName( section.compartment->pName ) :
|
||||
nullptr );
|
||||
section.load = GetSubmodelFromName( mdLoad, section.compartment->pName );
|
||||
|
||||
if( ( section.load != nullptr )
|
||||
&& ( section.load->count_children() > 0 ) ) {
|
||||
|
||||
Reference in New Issue
Block a user