16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-23 00:29:19 +02:00

another fixes for crashes on missing sounds

This commit is contained in:
milek7
2017-08-19 19:01:36 +02:00
parent 3bbef8bde5
commit d048b32531

View File

@@ -2933,8 +2933,7 @@ bool TController::PutCommand(std::string NewCommand, double NewValue1, double Ne
TrainParams = new TTrainParameters(NewCommand); // rozkład jazdy
else
TrainParams->NewName(NewCommand); // czyści tabelkę przystanków
delete tsGuardSignal;
tsGuardSignal = nullptr; // wywalenie kierownika
sound_man->destroy_sound(&tsGuardSignal); // wywalenie kierownika
if (NewCommand != "none")
{
if (!TrainParams->LoadTTfile(
@@ -2958,6 +2957,7 @@ bool TController::PutCommand(std::string NewCommand, double NewValue1, double Ne
if (FileExists(NewCommand))
{ // wczytanie dźwięku odjazdu podawanego bezpośrenido
tsGuardSignal = sound_man->create_text_sound(NewCommand);
if (tsGuardSignal)
tsGuardSignal->position(pVehicle->GetPosition());
// rsGuardSignal->Stop();
iGuardRadio = 0; // nie przez radio
@@ -2968,6 +2968,7 @@ bool TController::PutCommand(std::string NewCommand, double NewValue1, double Ne
if (FileExists(NewCommand))
{ // wczytanie dźwięku odjazdu w wersji radiowej (słychać tylko w kabinie)
tsGuardSignal = sound_man->create_text_sound(NewCommand);
if (tsGuardSignal)
tsGuardSignal->position(pVehicle->GetPosition());
iGuardRadio = iRadioChannel;
}
@@ -4299,6 +4300,8 @@ bool TController::UpdateSituation(double dt)
->DoorOpenCtrl ) // jeśli drzwi niesterowane przez maszynistę
Doors( false ); // a EZT zamknie dopiero po odegraniu komunikatu kierownika
if (tsGuardSignal)
{
tsGuardSignal->stop();
// w zasadzie to powinien mieć flagę, czy jest dźwiękiem radiowym, czy
// bezpośrednim
@@ -4319,6 +4322,7 @@ bool TController::UpdateSituation(double dt)
tsGuardSignal->position(pVehicle->GetPosition()).play();
}
}
}
if (mvOccupied->V == 0.0)
AbsAccS = fAccGravity; // Ra 2014-03: jesli skład stoi, to działa na niego
// składowa styczna grawitacji