Fixed some snapshot bugs, net crashes

This commit is contained in:
Anuken
2018-06-28 21:04:01 -04:00
parent ab82faf7ba
commit 499671a637
5 changed files with 22 additions and 7 deletions
@@ -38,6 +38,12 @@ public class Interpolator {
public void update(){
if(pos.dst(target) > 128){
pos.set(target);
lastUpdated = 0;
updateSpacing = 16;
}
if(lastUpdated != 0 && updateSpacing != 0){
float timeSinceUpdate = TimeUtils.timeSinceMillis(lastUpdated);
float alpha = Math.min(timeSinceUpdate / updateSpacing, 2f);