Misc bugfixes

This commit is contained in:
Anuken
2022-05-08 17:07:06 -04:00
parent a7ecdf8aab
commit 668b09e955
19 changed files with 52 additions and 38 deletions

View File

@@ -1828,7 +1828,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
case powerNetStored -> power == null ? 0 : power.graph.getLastPowerStored();
case powerNetCapacity -> power == null ? 0 : power.graph.getLastCapacity();
case enabled -> enabled ? 1 : 0;
case controlled -> this instanceof ControlBlock c && c.isControlled() ? GlobalConstants.ctrlPlayer : 0;
case controlled -> this instanceof ControlBlock c && c.isControlled() ? GlobalVars.ctrlPlayer : 0;
case payloadCount -> getPayload() != null ? 1 : 0;
case size -> block.size;
default -> Float.NaN; //gets converted to null in logic

View File

@@ -28,7 +28,7 @@ import mindustry.world.blocks.environment.*;
import mindustry.world.blocks.payloads.*;
import static mindustry.Vars.*;
import static mindustry.logic.GlobalConstants.*;
import static mindustry.logic.GlobalVars.*;
@Component(base = true)
abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, Itemsc, Rotc, Unitc, Weaponsc, Drawc, Boundedc, Syncc, Shieldc, Displayable, Senseable, Ranged, Minerc, Builderc{