Fix setting the wall clock crashing with OW_USE_FAKE_RTC set to FALSE and LTO=1
This commit is contained in:
parent
ae3369e87f
commit
9316635687
@ -50,6 +50,9 @@ void FakeRtc_TickTimeForward(void)
|
||||
|
||||
void FakeRtc_AdvanceTimeBy(u32 days, u32 hours, u32 minutes, u32 seconds)
|
||||
{
|
||||
if (!OW_USE_FAKE_RTC)
|
||||
return;
|
||||
|
||||
struct DateTime dateTime;
|
||||
struct SiiRtcInfo *rtc = FakeRtc_GetCurrentTime();
|
||||
|
||||
@ -63,6 +66,9 @@ void FakeRtc_AdvanceTimeBy(u32 days, u32 hours, u32 minutes, u32 seconds)
|
||||
|
||||
void FakeRtc_ForwardTimeTo(u32 hour, u32 minute, u32 second)
|
||||
{
|
||||
if (!OW_USE_FAKE_RTC)
|
||||
return;
|
||||
|
||||
Script_PauseFakeRtc();
|
||||
struct Time diff, target;
|
||||
struct SiiRtcInfo *fakeRtc = FakeRtc_GetCurrentTime();
|
||||
|
||||
@ -349,7 +349,8 @@ void RtcCalcLocalTimeOffset(s32 days, s32 hours, s32 minutes, s32 seconds)
|
||||
gLocalTime.hours = hours;
|
||||
gLocalTime.minutes = minutes;
|
||||
gLocalTime.seconds = seconds;
|
||||
FakeRtc_ManuallySetTime(gLocalTime.days, gLocalTime.hours, gLocalTime.minutes, seconds);
|
||||
if (!OW_USE_FAKE_RTC)
|
||||
FakeRtc_ManuallySetTime(gLocalTime.days, gLocalTime.hours, gLocalTime.minutes, seconds);
|
||||
RtcGetInfo(&sRtc);
|
||||
RtcCalcTimeDifference(&sRtc, &gSaveBlock2Ptr->localTimeOffset, &gLocalTime);
|
||||
}
|
||||
|
||||
@ -3239,6 +3239,9 @@ bool8 ScrCmd_fwdtime(struct ScriptContext *ctx)
|
||||
|
||||
bool8 ScrCmd_fwdweekday(struct ScriptContext *ctx)
|
||||
{
|
||||
if (!OW_USE_FAKE_RTC)
|
||||
return FALSE;
|
||||
|
||||
struct SiiRtcInfo *rtc = FakeRtc_GetCurrentTime();
|
||||
|
||||
u32 weekdayTarget = ScriptReadWord(ctx);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user