[2.0.31] Railguns mark targets that don't collide with the beam as in the danger zone, when they can't be damaged
Posted: Fri Jan 17, 2025 11:56 pm
Consider an entity with no collision mask layers. It collides with no objects.
When this entity is placed in front of a railgun and the player selects the railgun, it still marks this entity has being in danger of being damaged.
However when the railgun shoots through the entity, the entity is not damaged.

(Cryogenic plant has no collision mask layers, the oil refinery is unchanged)
Expected behaviour: When selecting/placing a railgun turret it does not show the red marks around the selection box of entities that can't be damaged by the railgun, in this case, the cryogenic plant.
Usecase: I've got some invisible entities in my mod that will trigger some effects when a player hovers over it. Their selection box becomes visible when placing railgun turrets.
---
I checked some more collision_mask settings:
Having it collide with some collision layers but setting "colliding_with_tiles_only" also results in it not being destroyed but still being marked.
As well as setting it to indestructable "/c game.player.selected.destructible = false".
But that can change at runtime, so I don't necessarily consider it a bug in that case.
Code: Select all
data.raw["assembling-machine"]["cryogenic-plant"].collision_mask = {layers = {}}
However when the railgun shoots through the entity, the entity is not damaged.

(Cryogenic plant has no collision mask layers, the oil refinery is unchanged)
Expected behaviour: When selecting/placing a railgun turret it does not show the red marks around the selection box of entities that can't be damaged by the railgun, in this case, the cryogenic plant.
Usecase: I've got some invisible entities in my mod that will trigger some effects when a player hovers over it. Their selection box becomes visible when placing railgun turrets.
---
I checked some more collision_mask settings:
Having it collide with some collision layers but setting "colliding_with_tiles_only" also results in it not being destroyed but still being marked.
Code: Select all
data.raw["assembling-machine"]["cryogenic-plant"].collision_mask = {
layers = {["player"] = true},
colliding_with_tiles_only = true
}
But that can change at runtime, so I don't necessarily consider it a bug in that case.