mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 23:35:28 +01:00
fix: the derailment notice builds on the layout of #531: physics/derailment.h, TDynamicObject::physics
This commit is contained in:
@@ -13,7 +13,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "simulation/simulation.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
#include "input/command.h"
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
#include "vehicle/Driver.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "vehicle/Train.h"
|
||||
@@ -616,11 +616,11 @@ void blackbox_recorder::write_derailed(TDynamicObject const *Vehicle, derailment
|
||||
state.time = m_time;
|
||||
state.vehicle = vehicle_id(Vehicle);
|
||||
state.phase = blackbox::derailment_phases::derailed;
|
||||
state.cause = cause_of(Notice.why, Vehicle->MoverParameters->Derailed);
|
||||
state.cause = cause_of(Notice.why, Vehicle->physics->Derailed);
|
||||
state.position = Vehicle->GetPosition();
|
||||
state.heading = static_cast<float>(std::atan2(Vehicle->VectorFront().x, Vehicle->VectorFront().z));
|
||||
// as it derailed, along its front as it moves now
|
||||
state.speed_kmh = static_cast<float>(std::copysign(Notice.velocity, Vehicle->MoverParameters->V));
|
||||
state.speed_kmh = static_cast<float>(std::copysign(Notice.velocity, Vehicle->physics->V));
|
||||
state.reason = static_cast<std::uint8_t>(Notice.why);
|
||||
state.track = text_of(Notice.track);
|
||||
m_writer->derailment(state);
|
||||
|
||||
Reference in New Issue
Block a user