Multiplayer bugfixes

This commit is contained in:
Anuken
2020-07-09 13:13:57 -04:00
parent 29e9d064df
commit 2584197a02
24 changed files with 139 additions and 70 deletions

View File

@@ -1,6 +1,7 @@
package mindustry.entities.comp;
import arc.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import arc.scene.ui.layout.*;
@@ -233,11 +234,15 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
//remove units spawned by the core
if(spawnedByCore && !isPlayer()){
Fx.unitDespawn.at(x, y, 0, this);
remove();
Call.unitDespawn(base());
}
}
/** @return a preview icon for this unit. */
public TextureRegion icon(){
return type.icon(Cicon.full);
}
/** Actually destroys the unit, removing it and creating explosions. **/
public void destroy(){
float explosiveness = 2f + item().explosiveness * stack().amount;