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