From 296f195a7edf1082898445f2a655d7667027d7e0 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Mon, 30 Dec 2019 14:24:09 +0100 Subject: [PATCH] Unload only in facing direction --- core/src/mindustry/content/UnitTypes.java | 2 +- core/src/mindustry/entities/type/base/CraterUnit.java | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index e6e5dc6535..9261aed54a 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -21,7 +21,7 @@ public class UnitTypes implements ContentList{ maxVelocity = 0.75f; speed = 0.1f; drag = 0.25f; - hitsize = 4f; + hitsize = 3.5f; mass = 0.5f; health = 50; rotatespeed = 0.1f; diff --git a/core/src/mindustry/entities/type/base/CraterUnit.java b/core/src/mindustry/entities/type/base/CraterUnit.java index 19dc2f1f75..0a1cd2c09c 100644 --- a/core/src/mindustry/entities/type/base/CraterUnit.java +++ b/core/src/mindustry/entities/type/base/CraterUnit.java @@ -55,12 +55,8 @@ public class CraterUnit extends GroundUnit{ return; } - if(item.amount-- <= 0) return; // update will take care of poofing - - // try to unload - int rot = on().rotation(); - on().block().offloadNear(on(), item.item); - on().rotation(rot); + if(item.amount == 0) return; // update will take care of poofing + if(on().block().offloadDir(on(), item.item)) item.amount--; } }; @@ -89,7 +85,7 @@ public class CraterUnit extends GroundUnit{ @Override public void added(){ super.added(); - Effects.effect(io, x, y); // poof into existence + Effects.effect(io, x, y); // poof in to existence baseRotation = rotation; // needed to prevent wobble: load > move }