Unload only in facing direction

This commit is contained in:
Patrick 'Quezler' Mounier
2019-12-30 14:24:09 +01:00
parent f52fe3052e
commit 296f195a7e
2 changed files with 4 additions and 8 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ public class UnitTypes implements ContentList{
maxVelocity = 0.75f; maxVelocity = 0.75f;
speed = 0.1f; speed = 0.1f;
drag = 0.25f; drag = 0.25f;
hitsize = 4f; hitsize = 3.5f;
mass = 0.5f; mass = 0.5f;
health = 50; health = 50;
rotatespeed = 0.1f; rotatespeed = 0.1f;
@@ -55,12 +55,8 @@ public class CraterUnit extends GroundUnit{
return; return;
} }
if(item.amount-- <= 0) return; // update will take care of poofing if(item.amount == 0) return; // update will take care of poofing
if(on().block().offloadDir(on(), item.item)) item.amount--;
// try to unload
int rot = on().rotation();
on().block().offloadNear(on(), item.item);
on().rotation(rot);
} }
}; };
@@ -89,7 +85,7 @@ public class CraterUnit extends GroundUnit{
@Override @Override
public void added(){ public void added(){
super.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 baseRotation = rotation; // needed to prevent wobble: load > move
} }