Revert "Stash failed collision preventer"

This reverts commit 0383d3b8d7.
This commit is contained in:
Patrick 'Quezler' Mounier
2019-12-31 18:54:45 +01:00
parent 0383d3b8d7
commit 7726d94566
2 changed files with 4 additions and 35 deletions

View File

@@ -37,7 +37,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
public static final float maxAbsVelocity = 127f / velocityPercision;
public static final int noSpawner = Pos.get(-1, 1);
protected static final Vec2 moveVector = new Vec2();
private static final Vec2 moveVector = new Vec2();
public float rotation;

View File

@@ -2,9 +2,7 @@ package mindustry.entities.type.base;
import arc.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import mindustry.entities.type.*;
import mindustry.ui.*;
import mindustry.type.*;
import mindustry.world.*;
@@ -34,39 +32,10 @@ public class CraterUnit extends GroundUnit{
},
move = new UnitState(){
public void update(){
// float radScl = 1.5f;
// float fsize = getSize() / radScl / 100;
// float cx = x - fsize/2f, cy = y - fsize/2f;
// move in the direction/rotation of the block its currently on
velocity.add(vec.trnsExact(angleTo(on().front()), type.speed * Time.delta()));
rotation = Mathf.slerpDelta(rotation, baseRotation, type.rotatespeed);
// Log.info(unitGroup.intersect(x, y, 3, 3).size);
// int size = unitGroup.intersect(cx, cy, fsize, fsize).select(unit -> {
// Log.info(lastPosition());
// Log.info(lastPosition().trns(45, tilesize));
// Vec2 front = lastPosition().cpy().add(lastPosition().trns(rotation, 6));
// return front.dst(unit) < 2;
// velocity.scl()
// }).size;
// Log.info(player.lastPosition());
// Log.info(lastPosition());
// Log.info(size);
//
// if(size < 1){
// if(moveVector.isZero()){
// move in the direction/rotation of the block its currently on
velocity.add(vec.trnsExact(angleTo(on().front()), type.speed * Time.delta()));
rotation = Mathf.slerpDelta(rotation, baseRotation, type.rotatespeed);
// }
// }
// velocity.
Log.info(moveVector);
// switch to unload when on an end tile
if(dst(on()) < 2.5f && on(Track.end)){
state.set(unload);