Stop shooting upon crawler death

This commit is contained in:
Anuken 2021-01-29 12:02:31 -05:00
parent d512aa5b21
commit 9142da2b70
3 changed files with 13 additions and 9 deletions

View File

@ -190,14 +190,10 @@ public class EntityCollisions{
yInvExit = y2 - (y1 + h1);
}
float xEntry, yEntry;
float xExit, yExit;
xEntry = xInvEntry / vx1;
xExit = xInvExit / vx1;
yEntry = yInvEntry / vy1;
yExit = yInvExit / vy1;
float xEntry = xInvEntry / vx1;
float xExit = xInvExit / vx1;
float yEntry = yInvEntry / vy1;
float yExit = yInvExit / vy1;
float entryTime = Math.max(xEntry, yEntry);
float exitTime = Math.min(xExit, yExit);

View File

@ -68,6 +68,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
public Seq<BuildPlan> lineRequests = new Seq<>();
public Seq<BuildPlan> selectRequests = new Seq<>();
public InputHandler(){
Events.on(UnitDestroyEvent.class, e -> {
if(e.unit != null && e.unit.isPlayer() && e.unit.getPlayer().isLocal() && e.unit.type.weapons.contains(w -> w.bullet.killShooter)){
player.shooting = false;
}
});
}
//methods to override
@Remote(called = Loc.server, unreliable = true)

View File

@ -23,7 +23,7 @@ import java.util.regex.*;
public class Scripts implements Disposable{
private final Seq<String> blacklist = Seq.with(".net.", "java.net", "files", "reflect", "javax", "rhino", "file", "channels", "jdk",
"runtime", "util.os", "rmi", "security", "org.", "sun.", "beans", "sql", "http", "exec", "compiler", "process", "system",
".awt", "socket", "classloader", "oracle", "invoke", "java.util.function", "java.util.stream", "org.");
".awt", "socket", "classloader", "oracle", "invoke", "java.util.function", "java.util.stream", "org.", "arc.net");
private final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "mindustry.gen.", "mindustry.logic.", "mindustry.async.", "saveio", "systemcursor");
private final Context context;
private final Scriptable scope;