Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken 2020-09-25 18:49:36 -04:00
commit c49b3124d5
2 changed files with 11 additions and 1 deletions

View file

@ -1,10 +1,12 @@
package mindustry.entities.comp;
import arc.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.game.EventType.*;
import mindustry.gen.*;
import mindustry.world.blocks.environment.*;
@ -90,7 +92,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
//TODO is the netClient check necessary?
if(drownTime >= 0.999f && !net.client()){
kill();
//TODO drown event!
Events.fire(new UnitDrownEvent(self()));
}
}else{
drownTime = Mathf.lerpDelta(drownTime, 0f, 0.03f);

View file

@ -270,6 +270,14 @@ public class EventType{
}
}
public static class UnitDrownEvent{
public final Unit unit;
public UnitDrownEvent(Unit unit){
this.unit = unit;
}
}
public static class UnitCreateEvent{
public final Unit unit;