This commit is contained in:
Anuken
2020-12-20 09:47:45 -05:00
parent f9fe396d1f
commit 4f683cac8b
2 changed files with 4 additions and 2 deletions

View File

@@ -126,6 +126,8 @@ public class Damage{
boolean collide = tile != null && collidedBlocks.add(tile.pos());
if(hitter.damage > 0){
float health = !collide ? 0 : tile.health;
if(collide && tile.team != team && tile.collide(hitter)){
tile.collision(hitter);
hitter.type.hit(hitter, tile.x, tile.y);
@@ -133,7 +135,7 @@ public class Damage{
//try to heal the tile
if(collide && hitter.type.testCollision(hitter, tile)){
hitter.type.hitTile(hitter, tile, tile.health, false);
hitter.type.hitTile(hitter, tile, health, false);
}
}
};

View File

@@ -37,7 +37,7 @@ public class RailBulletType extends BulletType{
}
void handle(Bullet b, Posc pos, float initialHealth){
float sub = initialHealth*pierceDamageFactor;
float sub = Math.max(initialHealth*pierceDamageFactor, 0);
if(b.damage <= 0){
b.fdata = Math.min(b.fdata, b.dst(pos));