This commit is contained in:
Anuken
2020-07-03 16:41:06 -04:00
parent 843a8c3e56
commit 7ff2e98420
11 changed files with 42 additions and 47 deletions

View File

@@ -72,11 +72,11 @@ abstract class BuilderComp implements Unitc{
BuildPlan current = buildPlan();
if(dst(current.tile()) > finalPlaceDst) return;
if(!within(current.tile(), finalPlaceDst)) return;
Tile tile = world.tile(current.x, current.y);
if(dst(tile) <= finalPlaceDst){
if(!within(tile, finalPlaceDst)){
rotation = Mathf.slerpDelta(rotation, angleTo(tile), 0.4f);
}

View File

@@ -40,7 +40,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{
public void update(){
Building core = closestCore();
if(core != null && mineTile != null && mineTile.drop() != null && !acceptsItem(mineTile.drop()) && dst(core) < mineTransferRange){
if(core != null && mineTile != null && mineTile.drop() != null && !acceptsItem(mineTile.drop()) && within(core, mineTransferRange)){
int accepted = core.acceptStack(item(), stack().amount, this);
if(accepted > 0){
Call.transferItemTo(item(), accepted,
@@ -63,7 +63,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{
if(mineTimer >= 50f + item.hardness*10f){
mineTimer = 0;
if(dst(core) < mineTransferRange && core.acceptStack(item, 1, this) == 1 && offloadImmediately()){
if(within(core, mineTransferRange) && core.acceptStack(item, 1, this) == 1 && offloadImmediately()){
Call.transferItemTo(item, 1,
mineTile.worldx() + Mathf.range(tilesize / 2f),
mineTile.worldy() + Mathf.range(tilesize / 2f), core.tile());