mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 03:52:52 +01:00
Merge staging into feat/derailment-event
# Conflicts: # McZapkie/Mover.cpp # vehicle/DynObj.cpp
This commit is contained in:
+12
-11
@@ -37,6 +37,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "utilities/Timer.h"
|
||||
#include "vehicle/Driver.h"
|
||||
#include "world/catenary_scene.h"
|
||||
#include "physics/vehicle.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
@@ -265,13 +266,13 @@ void state_manager::process_commands() {
|
||||
TDynamicObject *vehicle = found_vehicle;
|
||||
|
||||
while (vehicle) {
|
||||
vehicle->MoverParameters->Hamulec->Releaser(commanddata.action != GLFW_RELEASE ? 1 : 0);
|
||||
vehicle->physics->brakes.distributor->Releaser(commanddata.action != GLFW_RELEASE ? 1 : 0);
|
||||
vehicle = vehicle->Next();
|
||||
}
|
||||
|
||||
vehicle = found_vehicle;
|
||||
while (vehicle) {
|
||||
vehicle->MoverParameters->Hamulec->Releaser(commanddata.action != GLFW_RELEASE ? 1 : 0);
|
||||
vehicle->physics->brakes.distributor->Releaser(commanddata.action != GLFW_RELEASE ? 1 : 0);
|
||||
vehicle = vehicle->Prev();
|
||||
}
|
||||
}
|
||||
@@ -457,11 +458,11 @@ void state_manager::process_commands() {
|
||||
|
||||
while (vehicle) {
|
||||
// no damage, back on the rails with the state of the derailment cleared
|
||||
vehicle->MoverParameters->repair_damage();
|
||||
vehicle->MoverParameters->V = 0.000001; // HACK: force vehicle position re-calculation
|
||||
vehicle->MoverParameters->DistCounter = 0.0;
|
||||
vehicle->MoverParameters->OffsetTrackH = 0.0;
|
||||
vehicle->MoverParameters->OffsetTrackV = 0.0;
|
||||
vehicle->physics->repair_damage();
|
||||
vehicle->physics->V = 0.000001; // HACK: force vehicle position re-calculation
|
||||
vehicle->physics->DistCounter = 0.0;
|
||||
vehicle->physics->OffsetTrackH = 0.0;
|
||||
vehicle->physics->OffsetTrackV = 0.0;
|
||||
|
||||
// pantographs
|
||||
for( auto idx = 0; idx < vehicle->iAnimType[ ANIM_PANTS ]; ++idx ) {
|
||||
@@ -482,13 +483,13 @@ void state_manager::process_commands() {
|
||||
|
||||
if (commanddata.command == user_command::repaircoupler) {
|
||||
if (auto *vehicle{simulation::Vehicles.find(commanddata.payload)}; vehicle != nullptr) {
|
||||
vehicle->MoverParameters->repair_coupler(static_cast<int>(commanddata.param1) == end::rear ? end::rear : end::front);
|
||||
vehicle->physics->repair_coupler(EndOf(static_cast<int>(commanddata.param1)) == VehicleEnd::rear ? VehicleEnd::rear : VehicleEnd::front);
|
||||
}
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::fillcompressor) {
|
||||
TDynamicObject *vehicle = simulation::Vehicles.find(commanddata.payload);
|
||||
vehicle->MoverParameters->CompressedVolume = 8.0f * vehicle->MoverParameters->VeselVolume;
|
||||
vehicle->physics->air.compressedVolume = 8.0f * vehicle->physics->air.mainReservoirVolume;
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::dynamicmove) {
|
||||
@@ -518,7 +519,7 @@ void state_manager::process_commands() {
|
||||
double offset = 0.0;
|
||||
|
||||
while (vehicle) {
|
||||
offset += vehicle->MoverParameters->Dim.L;
|
||||
offset += vehicle->physics->Dim.L;
|
||||
vehicle->place_on_track(track, offset, false);
|
||||
vehicle = vehicle->Prev();
|
||||
}
|
||||
@@ -531,7 +532,7 @@ void state_manager::process_commands() {
|
||||
if (commanddata.command == user_command::pullalarmchain) {
|
||||
TDynamicObject *vehicle = simulation::Vehicles.find(commanddata.payload);
|
||||
if (vehicle)
|
||||
vehicle->MoverParameters->AlarmChainSwitch(true);
|
||||
vehicle->physics->AlarmChainSwitch(true);
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::sendaicommand) {
|
||||
|
||||
Reference in New Issue
Block a user