Bugfixes / Team access
This commit is contained in:
@@ -1171,6 +1171,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
public double sense(LAccess sensor){
|
||||
if(sensor == LAccess.x) return x;
|
||||
if(sensor == LAccess.y) return y;
|
||||
if(sensor == LAccess.team) return team.id;
|
||||
if(sensor == LAccess.health) return health;
|
||||
if(sensor == LAccess.efficiency) return efficiency();
|
||||
if(sensor == LAccess.rotation) return rotation;
|
||||
|
||||
@@ -76,6 +76,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
if(sensor == LAccess.health) return health;
|
||||
if(sensor == LAccess.x) return x;
|
||||
if(sensor == LAccess.y) return y;
|
||||
if(sensor == LAccess.team) return team.id;
|
||||
if(sensor == LAccess.shooting) return isShooting() ? 1 : 0;
|
||||
if(sensor == LAccess.shootX) return aimX();
|
||||
if(sensor == LAccess.shootY) return aimY();
|
||||
|
||||
@@ -23,10 +23,11 @@ public enum LAccess{
|
||||
shootX,
|
||||
shootY,
|
||||
shooting,
|
||||
team,
|
||||
|
||||
//values with parameters are considered controllable
|
||||
enabled("to"), //"to" is standard for single parameter access
|
||||
shoot("x", "y", "shoot");
|
||||
shoot("x", "y", "shoot"),;
|
||||
|
||||
public final String[] parameters;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class LogicBlock extends Block{
|
||||
|
||||
int bytelen = stream.readInt();
|
||||
byte[] bytes = new byte[bytelen];
|
||||
stream.read(bytes);
|
||||
stream.readFully(bytes);
|
||||
|
||||
int total = stream.readInt();
|
||||
|
||||
@@ -181,7 +181,7 @@ public class LogicBlock extends Block{
|
||||
|
||||
int bytelen = stream.readInt();
|
||||
byte[] bytes = new byte[bytelen];
|
||||
stream.read(bytes);
|
||||
stream.readFully(bytes);
|
||||
|
||||
links.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user