Fixed some high-FPS bugs

This commit is contained in:
Anuken
2018-09-03 16:22:24 -04:00
parent 8654f25a4f
commit a4f240edc8
3 changed files with 4 additions and 3 deletions

View File

@@ -217,7 +217,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
vec.set(target.getX() - x, target.getY() - y);
float length = Mathf.clamp((distanceTo(target) - circleLength) / 100f, -1f, 1f);
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((distanceTo(target) - circleLength) / 100f, -1f, 1f);
vec.setLength(type.speed * Timers.delta() * length);
if(length < 0) vec.rotate(180f);

View File

@@ -191,7 +191,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
public void update(){
ItemDrop item = (ItemDrop) target;
if(item == null || inventory.isFull() || !inventory.canAcceptItem(item.getItem(), 1)){
if(item == null || inventory.isFull() || item.getItem().type != ItemType.material || !inventory.canAcceptItem(item.getItem(), 1)){
setState(drop);
return;
}