minor bug fixes

This commit is contained in:
tmj-fstate
2019-02-06 16:48:03 +01:00
parent e71db46de0
commit 852fdcfa0e
5 changed files with 13 additions and 5 deletions

View File

@@ -9672,9 +9672,9 @@ bool TMoverParameters::RunCommand( std::string Command, double CValue1, double C
}
else if (Command == "DoorClose") /*NBMX*/
{ // Ra: uwzględnić trzeba jeszcze zgodność sprzęgów
if( ( Doors.open_control == control_t::conductor )
|| ( Doors.open_control == control_t::driver )
|| ( Doors.open_control == control_t::mixed ) ) {
if( ( Doors.close_control == control_t::conductor )
|| ( Doors.close_control == control_t::driver )
|| ( Doors.close_control == control_t::mixed ) ) {
// ignore remote command if the door is only operated locally
if( true == Battery ) {

View File

@@ -655,6 +655,10 @@ debug_panel::update_section_ai( std::vector<text_line> &Output ) {
// biezaca komenda dla AI
auto textline = "Current order: " + mechanik.OrderCurrent();
if( mechanik.fStopTime < 0.0 ) {
textline += "\n stop time: " + to_string( std::abs( mechanik.fStopTime ), 1 );
}
Output.emplace_back( textline, Global.UITextColor );
if( ( mechanik.VelNext == 0.0 )

View File

@@ -188,7 +188,7 @@ std::string cParser::readToken( bool ToLower, const char *Break ) {
c = tolower( c );
token += c;
if( findQuotes( token ) ) // do glue together words enclosed in quotes
break;
continue;
if( trimComments( token ) ) // don't glue together words separated with comment
break;
}

View File

@@ -124,7 +124,8 @@ basic_cell::update_events() {
// event launchers
for( auto *launcher : m_eventlaunchers ) {
if( ( true == ( launcher->check_activation() && launcher->check_conditions() ) )
&& ( SquareMagnitude( launcher->location() - Global.pCamera.Pos ) < launcher->dRadius ) ) {
&& ( ( launcher->dRadius < 0.0 )
|| ( SquareMagnitude( launcher->location() - Global.pCamera.Pos ) < launcher->dRadius ) ) ) {
launch_event( launcher );
}

View File

@@ -43,6 +43,8 @@ basic_station::update_load( TDynamicObject *First, Mtable::TTrainParameters &Sch
auto &parameters { *vehicle->MoverParameters };
if( parameters.Doors.range == 0.f ) { goto next; }
if( parameters.LoadType.name.empty() ) {
// (try to) set the cargo type for empty cars
parameters.LoadAmount = 0.f; // safety measure against edge cases
@@ -73,6 +75,7 @@ basic_station::update_load( TDynamicObject *First, Mtable::TTrainParameters &Sch
exchangetime = std::max( exchangetime, vehicle->LoadExchangeTime() );
}
}
next:
vehicle = vehicle->Next();
}