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

fix: mountable terrain usable for firing heavy weapons agian #4130

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

chaosvolt
Copy link
Member

Purpose of change

This sets it so mounds of dirt, open windows, and other terrain can support bipods and heavy weapons again.

Fixes #4126

Describe the solution

In ranged.cpp, updated the definition of is_mountable to check for passable tiles OR climb difficulty when screening out closed-off vehicle tiles from the check.

It seems that stuff that doesn't bother with any climb flags due to being a plain passable terrain, like mounds of dirt for example, are most likely keeping the inherited default climbing difficulty of INT_MAX, hence why the check borks because that value is definitely gonna be greater than 5.

Describe alternatives you've considered

Pestering @scarf005 to fix it instead.

Testing

  1. Compiled and load-tested.
  2. Confirmed I can once more fire an M2 Browning while on or adjacent to open windows and mounds of dirt.
  3. Tested a sandbag barricade to confirm that I can still use mountable furniture too.
  4. Tested editing a sandbag wall to count as mountable, confirmed it's not valid to mount heavy weapons on due to being impassable and not climbable.
  5. Spawned in RV, still barred from using closed doors and boards to mount heavy weapons, but able to when the door is opened.
  6. Checked affected file for astyle.

Additional context

Discovered while working on #4129

Checklist

@github-actions github-actions bot added the src changes related to source code. label Jan 19, 2024
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@scarf005 scarf005 merged commit 4aa83ce into cataclysmbnteam:main Jan 20, 2024
12 checks passed
@chaosvolt chaosvolt deleted the fix-mounting-terrain branch January 20, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mountable terrain no longer valid for firing heavy weapons
2 participants