mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-13 02:11:08 -07:00
If it don't collide, don't collide (#8388)
This commit is contained in:
parent
aec3e178f5
commit
b030a51485
1 changed files with 2 additions and 2 deletions
|
|
@ -160,7 +160,7 @@ public class Damage{
|
|||
//add distance to list so it can be processed
|
||||
var build = world.build(x, y);
|
||||
|
||||
if(build != null && build.team != b.team && b.checkUnderBuild(build, x * tilesize, y * tilesize)){
|
||||
if(build != null && build.team != b.team && build.collide(b) && b.checkUnderBuild(build, x * tilesize, y * tilesize)){
|
||||
distances.add(b.dst(build));
|
||||
|
||||
if(b.type.laserAbsorb && build.absorbLasers()){
|
||||
|
|
@ -237,7 +237,7 @@ public class Damage{
|
|||
seg2.set(seg1).add(vec);
|
||||
World.raycastEachWorld(x, y, seg2.x, seg2.y, (cx, cy) -> {
|
||||
Building tile = world.build(cx, cy);
|
||||
boolean collide = tile != null && hitter.checkUnderBuild(tile, cx * tilesize, cy * tilesize)
|
||||
boolean collide = tile != null && tile.collide(hitter) && hitter.checkUnderBuild(tile, cx * tilesize, cy * tilesize)
|
||||
&& ((tile.team != team && tile.collide(hitter)) || hitter.type.testCollision(hitter, tile)) && collidedBlocks.add(tile.pos());
|
||||
if(collide){
|
||||
collided.add(collidePool.obtain().set(cx * tilesize, cy * tilesize, tile));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue