Merge branch '4.0' of https://github.com/Anuken/Mindustry into 4.0
This commit is contained in:
@@ -18,6 +18,7 @@ import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Trail;
|
||||
import io.anuke.mindustry.net.In;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetConnection;
|
||||
import io.anuke.mindustry.type.*;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
@@ -58,7 +59,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
public Color color = new Color();
|
||||
public Mech mech;
|
||||
|
||||
public int clientid = -1;
|
||||
public NetConnection con;
|
||||
public int playerIndex = 0;
|
||||
public boolean isLocal = false;
|
||||
public Timer timer = new Timer(4);
|
||||
@@ -250,6 +251,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