mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
another fixes for crashes on missing sounds
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user