Page 1 of 1

[1.1.65] clamp_position ignores range_modifier for bullets

Posted: Mon Aug 08, 2022 9:57 pm
by BicycleEater
When modding in a new type of ammunition for the machine gun, if the range_modifier is set (e.g. to 2), it normally works fine, but if you set

Code: Select all

clamp_position = true
(with target_type = "position") then the firing range is clamped to the original range, rather than the modified range.

I've also tried setting

Code: Select all

ammo_type.action.action_delivery.max_range = 36
like in the cannon-shell, but this didn't work and wouldn't solve the problem as it would force incompatibility with mods adding different range machine guns.

I'd expect the clamping to use the final effective range, as that's the range that the targetting highlight changes to green, and with clamp_position = true, there is no other way of telling where you'll shoot.

I don't have a simple mod which gives the bug, although I could construct one fairly easily.
normal-ammo.png
normal-ammo.png (7.53 MiB) Viewed 658 times
special-ammo.png
special-ammo.png (7.51 MiB) Viewed 658 times
special-ammo-after-fire.png
special-ammo-after-fire.png (7.34 MiB) Viewed 658 times