diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index ff68aa20be..34a9f5c67e 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -596,10 +596,14 @@ public class EntityProcess extends BaseProcessor{ //write the groups groupsBuilder.addMethod(groupInit.build()); + groupsBuilder.addField(boolean.class, "isClearing", Modifier.PUBLIC, Modifier.STATIC); + MethodSpec.Builder groupClear = MethodSpec.methodBuilder("clear").addModifiers(Modifier.PUBLIC, Modifier.STATIC); + groupClear.addStatement("isClearing = true"); for(GroupDefinition group : groupDefs){ groupClear.addStatement("$L.clear()", group.name); } + groupClear.addStatement("isClearing = false"); //write clear groupsBuilder.addMethod(groupClear.build()); diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index d1829ddd6f..5a6aba4fcc 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -82,6 +82,11 @@ public class Renderer implements ApplicationListener{ public Renderer(){ camera = new Camera(); Shaders.init(); + + Events.on(ResetEvent.class, e -> { + shakeTime = shakeIntensity = 0f; + camShakeOffset.setZero(); + }); } public void shake(float intensity, float duration){ diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index a4a20c8460..a8258c78ea 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -67,6 +67,8 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw @Override public void remove(){ + if(Groups.isClearing) return; + //'despawned' only counts when the bullet is killed externally or reaches the end of life if(!hit){ type.despawned(self());