mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-06 17:08:56 +07:00
Return 1 for sensing dead
in null objects
This commit is contained in:
parent
b2d16f69da
commit
e1b0e07f3c
@ -636,6 +636,11 @@ public class LExecutor{
|
||||
Object target = exec.obj(from);
|
||||
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
|
||||
if(target instanceof Senseable se){
|
||||
if(sense instanceof Content co){
|
||||
|
@ -197,7 +197,7 @@ public class LogicBlock extends Block{
|
||||
public LExecutor executor = new LExecutor();
|
||||
public float accumulator = 0;
|
||||
public Seq<LogicLink> links = new Seq<>();
|
||||
public boolean checkedDuplicates = false, unboxed = false;
|
||||
public boolean checkedDuplicates = false;
|
||||
|
||||
public void readCompressed(byte[] data, boolean relative){
|
||||
DataInputStream stream = new DataInputStream(new InflaterInputStream(new ByteArrayInputStream(data)));
|
||||
@ -254,13 +254,10 @@ public class LogicBlock extends Block{
|
||||
super.onProximityAdded();
|
||||
|
||||
//unbox buildings after reading
|
||||
if(!unboxed){
|
||||
for(var v : executor.vars){
|
||||
if(v.objval instanceof BuildingBox b){
|
||||
v.objval = world.build(b.pos);
|
||||
}
|
||||
for(var v : executor.vars){
|
||||
if(v.objval instanceof BuildingBox b){
|
||||
v.objval = world.build(b.pos);
|
||||
}
|
||||
unboxed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user