From d3a15fba96a306595e025d3f0cbc45c0eede4d58 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 10 Aug 2021 21:47:28 -0400 Subject: [PATCH] Filter locked items from stat values --- core/src/mindustry/input/DesktopInput.java | 7 ------- core/src/mindustry/world/meta/StatValues.java | 8 ++------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index efe122e893..acb3795aff 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -646,13 +646,6 @@ public class DesktopInput extends InputHandler{ unit.moveAt(movement); }else{ unit.rotateMove(movement); - - unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len())); - - //problem: actual unit rotation is controlled by velocity, but velocity is 1) unpredictable and 2) can be set to 0 - if(!movement.isZero()){ - unit.rotation = Angles.moveToward(unit.rotation, movement.angle(), unit.type.rotateSpeed * Math.max(Time.delta, 1)); - } } unit.aim(unit.type.faceTarget ? Core.input.mouseWorld() : Tmp.v1.trns(unit.rotation, Core.input.mouseWorld().dst(unit)).add(unit.x, unit.y)); diff --git a/core/src/mindustry/world/meta/StatValues.java b/core/src/mindustry/world/meta/StatValues.java index 8be545047a..3d60297e47 100644 --- a/core/src/mindustry/world/meta/StatValues.java +++ b/core/src/mindustry/world/meta/StatValues.java @@ -49,11 +49,7 @@ public class StatValues{ public static StatValue liquids(Boolf filter, float amount, boolean perSecond){ return table -> { - Seq list = new Seq<>(); - - for(Liquid item : content.liquids()){ - if(!item.isHidden() && filter.get(item)) list.add(item); - } + Seq list = content.liquids().select(i -> filter.get(i) && i.unlockedNow()); for(int i = 0; i < list.size; i++){ table.add(new LiquidDisplay(list.get(i), amount, perSecond)).padRight(5); @@ -91,7 +87,7 @@ public class StatValues{ public static StatValue items(float timePeriod, Boolf filter){ return table -> { - Seq list = content.items().select(filter); + Seq list = content.items().select(i -> filter.get(i) && i.unlockedNow()); for(int i = 0; i < list.size; i++){ Item item = list.get(i);