Fixed #4054
This commit is contained in:
@@ -126,6 +126,8 @@ public class Damage{
|
|||||||
boolean collide = tile != null && collidedBlocks.add(tile.pos());
|
boolean collide = tile != null && collidedBlocks.add(tile.pos());
|
||||||
|
|
||||||
if(hitter.damage > 0){
|
if(hitter.damage > 0){
|
||||||
|
float health = !collide ? 0 : tile.health;
|
||||||
|
|
||||||
if(collide && tile.team != team && tile.collide(hitter)){
|
if(collide && tile.team != team && tile.collide(hitter)){
|
||||||
tile.collision(hitter);
|
tile.collision(hitter);
|
||||||
hitter.type.hit(hitter, tile.x, tile.y);
|
hitter.type.hit(hitter, tile.x, tile.y);
|
||||||
@@ -133,7 +135,7 @@ public class Damage{
|
|||||||
|
|
||||||
//try to heal the tile
|
//try to heal the tile
|
||||||
if(collide && hitter.type.testCollision(hitter, tile)){
|
if(collide && hitter.type.testCollision(hitter, tile)){
|
||||||
hitter.type.hitTile(hitter, tile, tile.health, false);
|
hitter.type.hitTile(hitter, tile, health, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class RailBulletType extends BulletType{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handle(Bullet b, Posc pos, float initialHealth){
|
void handle(Bullet b, Posc pos, float initialHealth){
|
||||||
float sub = initialHealth*pierceDamageFactor;
|
float sub = Math.max(initialHealth*pierceDamageFactor, 0);
|
||||||
|
|
||||||
if(b.damage <= 0){
|
if(b.damage <= 0){
|
||||||
b.fdata = Math.min(b.fdata, b.dst(pos));
|
b.fdata = Math.min(b.fdata, b.dst(pos));
|
||||||
|
|||||||
Reference in New Issue
Block a user