Fixed some high-FPS bugs
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user