Bugfixes
This commit is contained in:
@@ -3,4 +3,5 @@ package mindustry.logic;
|
||||
/** An object that can be controlled with logic. */
|
||||
public interface Controllable{
|
||||
void control(LAccess type, double p1, double p2, double p3, double p4);
|
||||
void control(LAccess type, Object p1, double p2, double p3, double p4);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,12 @@ public enum LAccess{
|
||||
//values with parameters are considered controllable
|
||||
enabled("to"), //"to" is standard for single parameter access
|
||||
shoot("x", "y", "shoot"),
|
||||
shootp(true, "unit", "shoot")
|
||||
|
||||
;
|
||||
|
||||
public final String[] parameters;
|
||||
public final boolean isObj;
|
||||
|
||||
public static final LAccess[]
|
||||
all = values(),
|
||||
@@ -42,5 +44,11 @@ public enum LAccess{
|
||||
|
||||
LAccess(String... parameters){
|
||||
this.parameters = parameters;
|
||||
isObj = false;
|
||||
}
|
||||
|
||||
LAccess(boolean obj, String... parameters){
|
||||
this.parameters = parameters;
|
||||
isObj = obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,11 @@ public class LExecutor{
|
||||
Object obj = exec.obj(target);
|
||||
if(obj instanceof Controllable){
|
||||
Controllable cont = (Controllable)obj;
|
||||
cont.control(type, exec.num(p1), exec.num(p2), exec.num(p3), exec.num(p4));
|
||||
if(type.isObj){
|
||||
cont.control(type, exec.obj(p1), exec.num(p2), exec.num(p3), exec.num(p4));
|
||||
}else{
|
||||
cont.control(type, exec.num(p1), exec.num(p2), exec.num(p3), exec.num(p4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user