mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
compressor governor lock tweaks, fuel pump cab indicator, optional offset for scenario clock
This commit is contained in:
@@ -10,6 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "mtable.h"
|
||||
|
||||
#include "globals.h"
|
||||
#include "world.h"
|
||||
#include "utilities.h"
|
||||
|
||||
@@ -521,20 +522,21 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
// NextStationName:=TimeTable[1].StationName;
|
||||
/* TTVmax:=TimeTable[1].vmax; */
|
||||
}
|
||||
if ((iPlus != 0)) // jeżeli jest przesunięcie rozkładu
|
||||
auto const timeoffset { static_cast<int>( Global.ScenarioTimeOffset * 60 ) + iPlus };
|
||||
if( timeoffset != 0.0 ) // jeżeli jest przesunięcie rozkładu
|
||||
{
|
||||
long i_end = StationCount + 1;
|
||||
for (i = 1; i < i_end; ++i) // bez with, bo ciężko się przenosi na C++
|
||||
{
|
||||
if ((TimeTable[i].Ah >= 0))
|
||||
{
|
||||
time = iPlus + TimeTable[i].Ah * 60 + TimeTable[i].Am; // nowe minuty
|
||||
time = clamp_circular( TimeTable[i].Ah * 60 + TimeTable[i].Am + timeoffset, 1440 ); // nowe minuty
|
||||
TimeTable[i].Am = time % 60;
|
||||
TimeTable[i].Ah = (time /*div*/ / 60) % 60;
|
||||
}
|
||||
if ((TimeTable[i].Dh >= 0))
|
||||
{
|
||||
time = iPlus + TimeTable[i].Dh * 60 + TimeTable[i].Dm; // nowe minuty
|
||||
time = clamp_circular( TimeTable[i].Dh * 60 + TimeTable[i].Dm + timeoffset, 1440 ); // nowe minuty
|
||||
TimeTable[i].Dm = time % 60;
|
||||
TimeTable[i].Dh = (time /*div*/ / 60) % 60;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user