Fix the disparity between acccumulator increase and time waited in WaitI (#11631)
This commit is contained in:
@@ -523,8 +523,6 @@ public class LogicBlock extends Block{
|
|||||||
if(state.rules.disableWorldProcessors && privileged) return;
|
if(state.rules.disableWorldProcessors && privileged) return;
|
||||||
|
|
||||||
if(enabled && executor.initialized()){
|
if(enabled && executor.initialized()){
|
||||||
accumulator += edelta() * ipt;
|
|
||||||
|
|
||||||
if(accumulator > maxInstructionScale * ipt) accumulator = maxInstructionScale * ipt;
|
if(accumulator > maxInstructionScale * ipt) accumulator = maxInstructionScale * ipt;
|
||||||
|
|
||||||
while(accumulator >= 1f){
|
while(accumulator >= 1f){
|
||||||
@@ -535,6 +533,10 @@ public class LogicBlock extends Block{
|
|||||||
}
|
}
|
||||||
accumulator --;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user