mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-03 22:21:17 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f5a0528c73
@ -93,6 +93,8 @@ public class BulletType extends Content implements Cloneable{
|
||||
public boolean collides = true;
|
||||
/** If true, this projectile collides with non-surface floors. */
|
||||
public boolean collideFloor = false;
|
||||
/** If true, this projectile collides with static walls */
|
||||
public boolean collideTerrain = false;
|
||||
/** Whether velocity is inherited from the shooter. */
|
||||
public boolean keepVelocity = true;
|
||||
/** Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. */
|
||||
|
@ -14,6 +14,7 @@ import mindustry.game.Teams.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.environment.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@ -140,9 +141,12 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
||||
while(x >= 0 && y >= 0 && x < ww && y < wh){
|
||||
Building build = world.build(x, y);
|
||||
|
||||
if(type.collideFloor){
|
||||
if(type.collideFloor || type.collideTerrain){
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile == null || tile.floor().hasSurface() || tile.block() != Blocks.air){
|
||||
if(
|
||||
type.collideFloor && (tile == null || tile.floor().hasSurface() || tile.block() != Blocks.air) ||
|
||||
type.collideTerrain && tile != null && tile.block() instanceof StaticWall
|
||||
){
|
||||
type.despawned(self());
|
||||
remove();
|
||||
hit = true;
|
||||
|
Loading…
Reference in New Issue
Block a user