mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-27 08:00:04 +07:00
Merge pull request #3676 from Quezler/patch-74
Fix BlockForge progress bar & recenter payload
This commit is contained in:
commit
327442f6fe
@ -41,7 +41,7 @@ public class BlockForge extends PayloadAcceptor{
|
||||
public void setBars(){
|
||||
super.setBars();
|
||||
|
||||
bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, () -> ((BlockForgeBuild)entity).progress));
|
||||
bars.add("progress", (BlockForgeBuild entity) -> new Bar("bar.progress", Pal.ammo, () -> entity.recipe == null ? 0f : (float)(entity.progress / entity.recipe.buildCost)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -83,6 +83,7 @@ public class BlockForge extends PayloadAcceptor{
|
||||
if(progress >= recipe.buildCost){
|
||||
consume();
|
||||
payload = new BuildPayload(recipe, team);
|
||||
payVector.setZero();
|
||||
progress = 0f;
|
||||
}
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user