Page 1 of 1

[1.1.53] Off-center collision box allows rotation into colliding orientation

Posted: Wed Feb 16, 2022 5:23 am
by sparr

Code: Select all

local entity = table.deepcopy(data.raw["constant-combinator"]["constant-combinator"])
entity.name = "turntable"
entity.collision_box = {{0.0, 0.0}, {1.5, 1.5}}
data:extend({entity})
This entity has an off-center collision box. If you place it and rotate it such that the collision box is northwest of the sprite, you will not be able to place an inserter northwest of the sprite due to collision. However if you place the inserter there first then you will be able to rotate this entity such that the collision boxes overlap.

Re: [1.1.53] Off-center collision box allows rotation into colliding orientation

Posted: Fri Feb 24, 2023 1:22 pm
by boskid
Thanks for the report. I am going to call this not a bug. My fix for this case if applied would be to disallow rotating existing entity at all due to collision box not being rotationally symmetric around the {0,0} position but i am considering such fix to be possibly mod breaking and as such i am not going to do that. Instead if you want to prevent this entity from being rotated you can use "not-rotatable" flag on the EntityPrototype. There is no logic in the game that would prevent rotation if the box is not symmetric because we assume entities are not rotatable in those cases.

Re: [1.1.53] Off-center collision box allows rotation into colliding orientation

Posted: Wed Mar 01, 2023 3:05 pm
by sparr
Can we get that expectation/constraint mentioned in the prototype docs?