Bugfixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package mindustry.entities;
|
||||
|
||||
import arc.*;
|
||||
import arc.func.*;
|
||||
import arc.math.geom.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
@@ -18,6 +19,15 @@ public class Units{
|
||||
private static float cdist;
|
||||
private static boolean boolResult;
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void unitCapDeath(Unit unit){
|
||||
if(unit != null){
|
||||
unit.dead = true;
|
||||
Fx.unitCapKill.at(unit);
|
||||
Core.app.post(() -> Call.unitDeath(unit.id));
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void unitDeath(int uid){
|
||||
Unit unit = Groups.unit.getByID(uid);
|
||||
|
||||
@@ -209,6 +209,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
//check if over unit cap
|
||||
if(count() > cap() && !spawnedByCore){
|
||||
deactivated = true;
|
||||
|
||||
if(!dead){
|
||||
Call.unitCapDeath(self());
|
||||
}
|
||||
}else{
|
||||
teamIndex.updateActiveCount(team, type, 1);
|
||||
}
|
||||
@@ -245,6 +249,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
a.update(self());
|
||||
}
|
||||
}
|
||||
}else if(!dead){
|
||||
Call.unitCapDeath(self());
|
||||
}
|
||||
|
||||
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f);
|
||||
|
||||
Reference in New Issue
Block a user