Unload only in facing direction
This commit is contained in:
@@ -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--;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user