Skip to content

Commit

Permalink
Train: reset Decoder throttle on emergency stop
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgit committed Sep 14, 2024
1 parent 088aa03 commit 8af8453
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/src/train/train.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ Train::Train(World& world, std::string_view _id) :
//Propagate to all vehicles in this Train
for(const auto& vehicle : m_poweredVehicles)
vehicle->setEmergencyStop(value);

if(value)
{
// Also reset Decoder throttle
for(const auto& vehicle : m_poweredVehicles)
driveLocomotive(vehicle, 0);
}
}
}},
weight{*this, "weight", 0, WeightUnit::Ton, PropertyFlags::ReadWrite | PropertyFlags::Store},
Expand Down

0 comments on commit 8af8453

Please sign in to comment.