16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 07:59:18 +02:00

reformat: remove redundant 'else' keyword

This commit is contained in:
jerrrrycho
2026-07-04 05:50:57 +02:00
parent 31f9ca0afc
commit b4b6686320
14 changed files with 482 additions and 331 deletions

View File

@@ -169,15 +169,19 @@ bool TTrainParameters::IsTimeToGo(double hh, double mm)
{
if (StationIndex < 1)
return true; // przed pierwszą jechać
else if (StationIndex < StationCount)
{ // oprócz ostatniego przystanku
if (TimeTable[StationIndex].Ah < 0) // odjazd z poprzedniego
return true; // czas przyjazdu nie był podany - przelot
else
return CompareTime(hh, mm, TimeTable[StationIndex].Dh, TimeTable[StationIndex].Dm) <= 0;
}
else // gdy rozkład się skończył
return false; // dalej nie jechać
else
{
if (StationIndex < StationCount)
{ // oprócz ostatniego przystanku
if (TimeTable[StationIndex].Ah < 0) // odjazd z poprzedniego
return true; // czas przyjazdu nie był podany - przelot
else
return CompareTime(hh, mm, TimeTable[StationIndex].Dh, TimeTable[StationIndex].Dm) <= 0;
}
// gdy rozkład się skończył
return false;
}
// dalej nie jechać
}
// returns: difference between specified time and scheduled departure from current stop, in seconds