mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 11:10:50 +03:00
Null check for displayFlow
This commit is contained in:
@@ -97,7 +97,7 @@ public class ItemModule extends BlockModule{
|
|||||||
|
|
||||||
/** @return a specific item's flow rate in items/s; any value < 0 means not ready.*/
|
/** @return a specific item's flow rate in items/s; any value < 0 means not ready.*/
|
||||||
public float getFlowRate(Item item){
|
public float getFlowRate(Item item){
|
||||||
return flow == null ? -1f : displayFlow[item.id] * 60;
|
return flow == null ? -1f : displayFlow != null ? displayFlow[item.id] * 60 : -1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFlowItem(Item item){
|
public boolean hasFlowItem(Item item){
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class LiquidModule extends BlockModule{
|
|||||||
|
|
||||||
/** @return current liquid's flow rate in u/s; any value < 0 means 'not ready'. */
|
/** @return current liquid's flow rate in u/s; any value < 0 means 'not ready'. */
|
||||||
public float getFlowRate(Liquid liquid){
|
public float getFlowRate(Liquid liquid){
|
||||||
return flow == null ? -1f : displayFlow[liquid.id] * 60;
|
return flow == null ? -1f : displayFlow != null ? displayFlow[liquid.id] * 60 : -1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFlowLiquid(Liquid liquid){
|
public boolean hasFlowLiquid(Liquid liquid){
|
||||||
|
|||||||
Reference in New Issue
Block a user