mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-05 15:58:14 +07:00
Update target before launch
So it has the chance to make room before it receives the crater from the caller.
This commit is contained in:
@ -73,6 +73,9 @@ public class CraterConveyor extends BaseConveyor{
|
||||
public void update(Tile tile){
|
||||
CraterConveyorEntity entity = tile.ent();
|
||||
|
||||
if(entity.lastFrameUpdated == Core.graphics.getFrameId()) return;
|
||||
entity.lastFrameUpdated = Core.graphics.getFrameId();
|
||||
|
||||
if(entity.crater == null){
|
||||
if(entity.items.total() > 0){
|
||||
entity.crater = new Crater(tile);
|
||||
@ -86,6 +89,7 @@ public class CraterConveyor extends BaseConveyor{
|
||||
|
||||
if(shouldLaunch(tile)){
|
||||
Tile destination = tile.front();
|
||||
destination.block().update(destination);
|
||||
|
||||
if(entity.crater.dst(tile) < 1.25f){
|
||||
entity.crater.f = tile.rotation() * 90 - 90;
|
||||
@ -121,6 +125,7 @@ public class CraterConveyor extends BaseConveyor{
|
||||
|
||||
public class CraterConveyorEntity extends BaseConveyorEntity{
|
||||
Crater crater;
|
||||
float lastFrameUpdated = -1;
|
||||
}
|
||||
|
||||
protected class Crater implements Position{
|
||||
|
Reference in New Issue
Block a user