Bugfix: laserbolt pierces plast walls (#12573)

* Bugfix: laserbolt pierces plast walls

* whether ugh
This commit is contained in:
EggleEgg
2026-09-01 19:59:09 -04:00
committed by GitHub
parent cf41adda2b
commit d2ee7cdf42
3 changed files with 9 additions and 0 deletions
@@ -64,6 +64,8 @@ public class BulletType extends Content implements Cloneable{
public boolean removeAfterPierce = true;
/** For piercing lasers, setting this to true makes it get absorbed by plastanium walls. */
public boolean laserAbsorb = true;
/** Whether this bullet is considered a laser bullet and thus absorbed by plastanium walls. */
public boolean laserBullet = false;
/** Life fraction at which this bullet has the best range/damage/etc. Used for lasers and continuous turrets. */
public float optimalLifeFract = 0f;
/** Z layer to drawn on. */
@@ -16,6 +16,7 @@ public class LaserBoltBulletType extends BasicBulletType{
despawnEffect = Fx.hitLaser;
hittable = false;
reflectable = false;
laserBullet = true;
lightColor = Pal.heal;
lightOpacity = 0.6f;
}
@@ -292,6 +292,12 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
remove();
}
if(type.laserBullet && build.absorbLasers()){
hit = true;
remove();
return;
}
//stop raycasting when building is hit
if(type.pierceBuilding) return;
}