Fix the disparity between acccumulator increase and time waited in WaitI (#11631)

This commit is contained in:
Cardillan
2026-02-07 20:30:34 -05:00
committed by GitHub
parent ef4e93c396
commit 9c0446a053
@@ -523,8 +523,6 @@ public class LogicBlock extends Block{
if(state.rules.disableWorldProcessors && privileged) return;
if(enabled && executor.initialized()){
accumulator += edelta() * ipt;
if(accumulator > maxInstructionScale * ipt) accumulator = maxInstructionScale * ipt;
while(accumulator >= 1f){
@@ -535,6 +533,10 @@ public class LogicBlock extends Block{
}
accumulator --;
}
// Do not move in front of the loop, otherwise the curTime accumulated in WaitI
// may get out of sync with the accumulator increase.
accumulator += edelta() * ipt;
}
}