More consistent status flash

This commit is contained in:
Anuken
2023-01-08 14:40:47 -05:00
parent dcc6e9827d
commit cba1e81f3d

View File

@@ -69,7 +69,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
transient String lastAccessed;
transient boolean wasDamaged; //used only by the indexer
transient float visualLiquid;
private transient float statusTimer;
/** TODO Each bit corresponds to a team ID. Only 64 are supported. Does not work on servers. */
transient long visibleFlags;
@@ -581,7 +580,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return BlockStatus.noInput;
}
return statusTimer < efficiency ? BlockStatus.active : BlockStatus.noInput;
return ((state.tick / 30f) % 1f) < efficiency ? BlockStatus.active : BlockStatus.noInput;
}
/** Call when nothing is happening to the entity. This increments the internal sleep timer. */
@@ -2023,8 +2022,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
//TODO just handle per-block instead
if(enabled || !block.noUpdateDisabled){
updateTile();
statusTimer = (statusTimer + efficiency/4f * Time.delta) % 1f;
}
}