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 rooftop shooting #52386

Merged
merged 4 commits into from
Oct 28, 2021
Merged

Fix rooftop shooting #52386

merged 4 commits into from
Oct 28, 2021

Conversation

Bejofo
Copy link
Contributor

@Bejofo Bejofo commented Oct 21, 2021

Summary

Bugfixes "Fix rooftop shooting"

Purpose of change

Fixes #49743 and #46333 hopefully.

Describe the solution

Whenever the bullet trajectory changes z-levels, check both tiles if there is a floor in between. This should still prevent the player
from shooting directly through the floor.

Testing

Compiled the game, and was able to shoot enemies as expected. Can also shoot enemies directly adjacent to you from rooftops.

Additional context

I might have screwed up the whitespace, I'm not sure how to edit commits.
Also my first time writing c++, I don't know what I'm doing.

@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Game: Balance Balancing of (existing) in-game features. Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics Z-levels Levels below and above ground. labels Oct 21, 2021
@BrettDong
Copy link
Member

@Maleclypse
Copy link
Member

Maleclypse commented Oct 23, 2021

Are you on windows? If you are on windows and have downloaded astyle you can create new notepad file. Type the following

echo off
cd Cataclysm-DDA

astyle --options=.astylerc --recursive src/*.cpp,*.h tests/*.cpp,*.h object_creator/*.cpp,*.h

then save the file as astyle.bat then double click it and it should astyle your file for you.

astyle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Game: Balance Balancing of (existing) in-game features. Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics Z-levels Levels below and above ground.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shooting across z levels always misses when enemies are hugging a wall.
5 participants