Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Vehicle turrets fired from controls aim from the wrong tile #22512
Game version: 0.c-25163-ga18e4b5f16-dirty (#6961)
Operating system: Linux
Tiles or curses: Curses
Mods active: Base game only
Firing a turret should aim from the turret's tile
Instead it starts aiming from the seat with the controls, causing problems with range calculations. Firing near maximum range will cause the turret to fail silently. This is most noticeable with short ranged weapons like flamethrowers.
Steps to reproduce the behavior
Spawn any vehicle in, and weld a flamethrower and a tank of napalm somewhere other than the driver's seat, farther away will make the problem more obvious. Press f, select a target somewhere far from the turret, and nothing happens.
This might be a case where good intentions are colliding with code;
On the other hand, and as you bring up with the example of hilariously short-ranged weapons, this leads to a problem with long vehicles, where the weapon itself has a hard and short range, which actually is within range of the target, but you would not be if you were firing that weapon from the tile you're sitting on.
I think the theory may be that aim penalties for range should be assessed from the player's tile, but dispersion, etc, should be assessed from the weapon's tile.
If you're going to go that route, then it seems to me it'll start to get complicated once you begin taking mirrors and cameras into account. I mean, I've got a camera display and a camera on the back of my vehicle. If I'm looking through the display, shouldn't I be aiming from that tile instead?