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;
speed = 0.1f;
drag = 0.25f;
hitsize = 4f;
hitsize = 3.5f;
mass = 0.5f;
health = 50;
rotatespeed = 0.1f;
@@ -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--;
}
};