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

scenario clock offset applied to event launchers

This commit is contained in:
tmj-fstate
2018-03-30 14:54:11 +02:00
parent 1fd89923f6
commit fe9f509b3b
4 changed files with 22 additions and 14 deletions

View File

@@ -62,7 +62,7 @@ simulation_time::init() {
::memcpy( m_monthdaycounts, monthdaycounts, sizeof( monthdaycounts ) );
// potentially adjust scenario clock
auto const requestedtime { clamp_circular<int>( m_time.wHour * 60 + m_time.wMinute + Global.ScenarioTimeOffset * 60, 1440 ) };
auto const requestedtime { clamp_circular<int>( m_time.wHour * 60 + m_time.wMinute + Global.ScenarioTimeOffset * 60, 24 * 60 ) };
auto const requestedhour { ( requestedtime / 60 ) % 60 };
auto const requestedminute { requestedtime % 60 };
// cache requested elements, if any