New avert sprite / Fixed loading of CommandAI positions
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -98,8 +98,8 @@ public class CommandAI extends AIController{
|
||||
}else if(local.size > 1){
|
||||
int count = 0;
|
||||
for(var near : local){
|
||||
//has arrived
|
||||
if(near.isCommandable() && !near.command().hasCommand() && targetPos.equals(near.command().lastTargetPos)){
|
||||
//has arrived - no current command, but last one is equal
|
||||
if(near.isCommandable() && !near.command().hasCommand() && targetPos.epsilonEquals(near.command().lastTargetPos, 0.001f)){
|
||||
count ++;
|
||||
}
|
||||
}
|
||||
@@ -181,6 +181,11 @@ public class CommandAI extends AIController{
|
||||
return targetPos != null;
|
||||
}
|
||||
|
||||
public void setupLastPos(){
|
||||
lastTargetPos = targetPos;
|
||||
|
||||
}
|
||||
|
||||
public void commandPosition(Vec2 pos){
|
||||
targetPos = pos;
|
||||
lastTargetPos = pos;
|
||||
|
||||
@@ -3149,8 +3149,9 @@ public class UnitTypes{
|
||||
itemCapacity = 0;
|
||||
|
||||
setEnginesMirror(
|
||||
new UnitEngine(34 / 4f, 31 / 4f, 3f, 45f),
|
||||
new UnitEngine(35 / 4f, -38 / 4f, 3f, 315f)
|
||||
//new UnitEngine(34 / 4f, 31 / 4f, 3f, 45f),
|
||||
new UnitEngine(35 / 4f, -38 / 4f, 3f, 315f),
|
||||
new UnitEngine(39 / 4f, -16 / 4f, 3f, 315f)
|
||||
);
|
||||
|
||||
weapons.add(new Weapon("avert-weapon"){{
|
||||
|
||||
@@ -490,6 +490,7 @@ public class TypeIO{
|
||||
}else{
|
||||
ai.targetPos = null;
|
||||
}
|
||||
ai.setupLastPos();
|
||||
|
||||
if(hasAttack){
|
||||
byte entityType = read.b();
|
||||
|
||||
@@ -518,8 +518,8 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
addBar("liquid-" + liq.name, entity -> new Bar(
|
||||
() -> liq.localizedName,
|
||||
liq::barColor,
|
||||
() -> entity.liquids.get(liq) / liquidCapacity)
|
||||
);
|
||||
() -> entity.liquids.get(liq) / liquidCapacity
|
||||
));
|
||||
}
|
||||
|
||||
/** Adds a liquid bar that dynamically displays a liquid type. */
|
||||
|
||||
Reference in New Issue
Block a user