Fixed various bugs and crashes
This commit is contained in:
@@ -250,6 +250,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
@Override
|
||||
public void removed() {
|
||||
dropCarryLocal();
|
||||
|
||||
TileEntity core = getClosestCore();
|
||||
if(core != null && ((CoreEntity)core).currentUnit == this){
|
||||
((CoreEntity)core).currentUnit = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,6 @@ import io.anuke.ucore.entities.trait.TimeTrait;
|
||||
import io.anuke.ucore.entities.trait.VelocityTrait;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.util.Pooling;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
@@ -48,7 +47,7 @@ public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawT
|
||||
private float sinktime;
|
||||
|
||||
public static ItemDrop create(Item item, int amount, float x, float y, float angle){
|
||||
ItemDrop drop = Pooling.obtain(ItemDrop.class);
|
||||
ItemDrop drop = new ItemDrop();
|
||||
drop.item = item;
|
||||
drop.amount = amount;
|
||||
drop.velocity.set(4f, 0f).rotate(angle);
|
||||
@@ -188,11 +187,6 @@ public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawT
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
Pooling.free(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
time = 0f;
|
||||
|
||||
Reference in New Issue
Block a user