From f47fb0161445795ebeab625e630c2ca8964c7dce Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 6 Sep 2018 09:08:54 -0400 Subject: [PATCH] Minor bugfixes --- core/src/io/anuke/mindustry/content/Mechs.java | 4 ++++ core/src/io/anuke/mindustry/entities/Player.java | 2 +- core/src/io/anuke/mindustry/type/Mech.java | 1 + .../anuke/mindustry/ui/fragments/BlockInventoryFragment.java | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java index a045094912..36b9d1f29e 100644 --- a/core/src/io/anuke/mindustry/content/Mechs.java +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -252,6 +252,7 @@ public class Mechs implements ContentList{ weaponOffsetX = -1; weaponOffsetY = -1; trailColor = Palette.lightTrail; + cellTrnsY = 1f; }}; javelin = new Mech("javelin-ship", true){ @@ -266,6 +267,7 @@ public class Mechs implements ContentList{ armor = 5f; weapon = Weapons.missiles; trailColor = Color.valueOf("d3ddff"); + cellTrnsY = 1f; } @Override @@ -321,6 +323,7 @@ public class Mechs implements ContentList{ itemCapacity = 30; trailColor = Color.valueOf("84f491"); weapon = Weapons.bomberTrident; + cellTrnsY = 1f; } @Override @@ -340,6 +343,7 @@ public class Mechs implements ContentList{ armor = 30f; itemCapacity = 60; trailColor = Color.valueOf("feb380"); + cellTrnsY = 1f; } }; diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index b7a36c3dae..2b7d1443a9 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -344,7 +344,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Timers.time(), healthf()*5f, 1f - healthf())); Draw.alpha(hitTime / hitDuration); - Draw.rect(getPowerCellRegion(), x, y, rotation - 90); + Draw.rect(getPowerCellRegion(), x + Angles.trnsx(rotation, mech.cellTrnsY, 0f), y + Angles.trnsy(rotation, mech.cellTrnsY, 0f), rotation - 90); Draw.color(); } diff --git a/core/src/io/anuke/mindustry/type/Mech.java b/core/src/io/anuke/mindustry/type/Mech.java index 3198cfcacf..e883488a0d 100644 --- a/core/src/io/anuke/mindustry/type/Mech.java +++ b/core/src/io/anuke/mindustry/type/Mech.java @@ -28,6 +28,7 @@ public class Mech extends UnlockableContent{ public float armor = 1f; public float altChargeAlpha = 0.1f; + public float cellTrnsY = 0f; public float mineSpeed = 1f; public int drillPower = -1; public float carryWeight = 10f; diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java index d015a44451..6faed6e1ba 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java @@ -44,7 +44,7 @@ public class BlockInventoryFragment extends Fragment{ @Remote(called = Loc.server, targets = Loc.both, forward = true) public static void requestItem(Player player, Tile tile, Item item, int amount){ - if(player == null) return; + if(player == null || tile == null) return; int removed = tile.block().removeStack(tile, item, amount);