fix: a train without vehicles can't be activated

Dieser Commit ist enthalten in:
Reinder Feenstra 2023-09-24 23:01:17 +02:00
Ursprung 29887fc748
Commit a03bcc835e

Datei anzeigen

@ -376,6 +376,11 @@ bool Train::setTrainActive(bool val)
if(val)
{
if(vehicles->empty())
{
return false; // activating a train without vehicles is useless.
}
//To activate a train, ensure all vehicles are stopped and free
for(const auto& vehicle : *vehicles)
{