Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Pawns don't take an ally's leaning into account when deciding whether it's safe (in terms of friendly-fire) to shoot. #2934

Open
basicsmods opened this issue Dec 27, 2023 · 2 comments · May be fixed by #2948
Labels
Bug Something isn't working

Comments

@basicsmods
Copy link

basicsmods commented Dec 27, 2023

image

In that screenshot, Ace is clearly leaning into Victoria's line of fire. Ideally, Victoria would realize this is unsafe and cancel her shot attempt. But the checks that happen to stop these kinds of things from happening don't take leaning into account. (So from the perspective of those checks, Ace is in the doorway and is not at risk.) And then you get brain injuries.

@basicsmods basicsmods added the Bug Something isn't working label Dec 27, 2023
@basicsmods basicsmods changed the title [Bug]: Pawns don't take leaning into account when deciding whether it's safe (in terms of friendly-fire) to shoot. [Bug]: Pawns don't take allies leaning into account when deciding whether it's safe (in terms of friendly-fire) to shoot. Dec 27, 2023
@basicsmods basicsmods changed the title [Bug]: Pawns don't take allies leaning into account when deciding whether it's safe (in terms of friendly-fire) to shoot. [Bug]: Pawns don't take an ally's leaning into account when deciding whether it's safe (in terms of friendly-fire) to shoot. Dec 27, 2023
@basicsmods
Copy link
Author

If anyone knows how to ask the question "is a pawn leaning?" and "which tile is the pawn leaning into?" then I could potentially try to implement the requested logic. I just don't know how to ask either of those questions and getting a pawn's .Position field just returns the coordinates of their original tile (which won't be in the way of the shot).

@basicsmods
Copy link
Author

Okay so I hacked together something that accomplishes most of what I'd want here. It's very far from an elegant solution though and it definitely shouldn't be put into CE like this. https://steamcommunity.com/sharedfiles/filedetails/?id=3124027427

From my testing, one of the main issues on this topic is that the shotLine used in Verb_LaunchProjectileCE.CanHitCellFromCellIgnoringRange(..) (the method that is used to determine whether or not a pawn should actually try to shoot or not) is different from the one used in ProjectileCE.TryCollideWith(..) (the method that actually confirms the impact of the fired shot).

I really think this issue should be looked into and fixed in CE itself, but for the time being, my extension mod accomplishes 97% of the behaviour that I'd want.

@github-project-automation github-project-automation bot moved this to In progress in 5.6 Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: In progress
1 participant