Workaround for TimeControl-specific NaN bug

This commit is contained in:
Anuken
2026-08-01 01:02:15 -04:00
parent 296d6cbdb9
commit 6ab65f735d
2 changed files with 5 additions and 2 deletions
@@ -685,7 +685,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
if(x > right - tilesize) dx -= (x - (right - tilesize))/warpDst;
if(y > top - tilesize) dy -= (y - (top - tilesize))/warpDst;
velAddNet(dx * Time.delta, dy * Time.delta);
//cap velocity to prevent infinity when using timecontrol or similar mods
float maxMagnitude = 10f / Math.max(Time.delta, 1f);
velAddNet(Mathf.clamp(dx * Time.delta, -maxMagnitude, maxMagnitude), Mathf.clamp(dy * Time.delta, -maxMagnitude, maxMagnitude));
float margin = tilesize * 1f;
x = Mathf.clamp(x, left - margin, right - tilesize + margin);
y = Mathf.clamp(y, bot - margin, top - tilesize + margin);
+1 -1
View File
@@ -26,4 +26,4 @@ org.gradle.caching=true
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
android.enableR8.fullMode=false
archash=c0f7099282
archash=b0880b136e