Return 1 for sensing dead in null objects
This commit is contained in:
@@ -636,6 +636,11 @@ public class LExecutor{
|
|||||||
Object target = exec.obj(from);
|
Object target = exec.obj(from);
|
||||||
Object sense = exec.obj(type);
|
Object sense = exec.obj(type);
|
||||||
|
|
||||||
|
if(target == null && sense == LAccess.dead){
|
||||||
|
exec.setnum(to, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//note that remote units/buildings can be sensed as well
|
//note that remote units/buildings can be sensed as well
|
||||||
if(target instanceof Senseable se){
|
if(target instanceof Senseable se){
|
||||||
if(sense instanceof Content co){
|
if(sense instanceof Content co){
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public class LogicBlock extends Block{
|
|||||||
public LExecutor executor = new LExecutor();
|
public LExecutor executor = new LExecutor();
|
||||||
public float accumulator = 0;
|
public float accumulator = 0;
|
||||||
public Seq<LogicLink> links = new Seq<>();
|
public Seq<LogicLink> links = new Seq<>();
|
||||||
public boolean checkedDuplicates = false, unboxed = false;
|
public boolean checkedDuplicates = false;
|
||||||
|
|
||||||
public void readCompressed(byte[] data, boolean relative){
|
public void readCompressed(byte[] data, boolean relative){
|
||||||
DataInputStream stream = new DataInputStream(new InflaterInputStream(new ByteArrayInputStream(data)));
|
DataInputStream stream = new DataInputStream(new InflaterInputStream(new ByteArrayInputStream(data)));
|
||||||
@@ -254,13 +254,10 @@ public class LogicBlock extends Block{
|
|||||||
super.onProximityAdded();
|
super.onProximityAdded();
|
||||||
|
|
||||||
//unbox buildings after reading
|
//unbox buildings after reading
|
||||||
if(!unboxed){
|
for(var v : executor.vars){
|
||||||
for(var v : executor.vars){
|
if(v.objval instanceof BuildingBox b){
|
||||||
if(v.objval instanceof BuildingBox b){
|
v.objval = world.build(b.pos);
|
||||||
v.objval = world.build(b.pos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
unboxed = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user