Multiblock damage calculation bugfix

This commit is contained in:
Anuken
2020-12-18 14:56:14 -05:00
parent 6783069f95
commit 8d43590657
2 changed files with 8 additions and 9 deletions

View File

@@ -389,11 +389,10 @@ public class Damage{
if(scaledDamage <= 0 || tile == null) continue;
//apply damage to entity if needed
if(tile.build != null && tile.team() != team){
int health = (int)tile.build.health();
if(tile.build.health() > 0){
if(tile.build != null && tile.build.team != team){
if(tile.build.health > 0){
tile.build.damage(scaledDamage);
scaledDamage -= health;
scaledDamage -= (int)(tile.build.health / (tile.block().size * tile.block().size));
if(scaledDamage <= 0) continue;
}

View File

@@ -318,8 +318,8 @@ public class CustomRulesDialog extends BaseDialog{
dialog.addCloseButton();
dialog.buttons.button("@add", Icon.add, () -> {
BaseDialog addd = new BaseDialog("@add");
addd.cont.pane(t -> {
BaseDialog add = new BaseDialog("@add");
add.cont.pane(t -> {
t.background(Tex.button);
int i = 0;
for(Weather weather : content.<Weather>getBy(ContentType.weather)){
@@ -328,13 +328,13 @@ public class CustomRulesDialog extends BaseDialog{
rules.weather.add(new WeatherEntry(weather));
rebuild[0].run();
addd.hide();
add.hide();
}).size(140f, 50f);
if(++i % 2 == 0) t.row();
}
});
addd.addCloseButton();
addd.show();
add.addCloseButton();
add.show();
}).width(170f);
//reset cooldown to random number