From 4d62ace31b16564caf3c2d87355fc13b4b4aafab Mon Sep 17 00:00:00 2001 From: rekadoodle Date: Fri, 16 Aug 2024 23:11:17 +0100 Subject: [PATCH] Attempted fix for game timer --- rainworlddp.asl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rainworlddp.asl b/rainworlddp.asl index ccaa141..553955c 100644 --- a/rainworlddp.asl +++ b/rainworlddp.asl @@ -319,8 +319,14 @@ gameTime { } else { if(vars.lastSafeTime != 0) { - deltaTime = Math.Max(time - vars.lastSafeTime, 0); - vars.lastSafeTime = 0; + int catchUpTime = Math.Max(time - vars.lastSafeTime, 0); + // this system is designed to capture moments when the memory value for the game time is totally wrong + // what I should really be doing is checking that the value is actually valid but instead I'm using this convoluted system and I'm commited to it now so I want it to work + // This only resets now if the adjustment time is lower than 30 seconds (ie. max time a lag spike might occur for) so hopefully this will fix the problem in the meantime + if(catchUpTime < 30000) { + deltaTime = catchUpTime; + vars.lastSafeTime = 0; + } } }