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 bitwise ops (including sentry flamer ammo) #7729

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

Drulikar
Copy link
Contributor

@Drulikar Drulikar commented Dec 3, 2024

About the pull request

This PR corrects a few bitwise ops I found using &[^\|\(]*\|[^\|] because of operation order. Basically flag & ALPHA|BRAVO is going to always be a truthy result (depends on the actual value for BRAVO) since its resolved as (flag & ALPHA)|BRAVO. The fixes to matrix editor would have already been caught by checking the admin holder. I don't know about dropship runway. But a potentially concerning one is w/ flame ammo.

Adds a grep lint to find ambiguous bitwise ORs like this using ^(?:[^\/\n]|\/[^\/\n])*(&[ \t]*\w+[ \t]*\|[ \t]*\w+) (complication came from supporting // though block quotes will still trip it which IMO is fine)

Explain why it's good for the game

These are clear mistakes, but this may make sentry flamer ammo more effective on non-immune xenos.

Fixes:
image

Testing Photographs and Procedure

Screenshots & Videos

fire

Linter: https://github.com/cmss13-devs/cmss13/actions/runs/12153015470/job/33890398213?pr=7729#step:7:36

Changelog

🆑 Drathek
fix: Fix code mistakes involving bitwise OR
balance: Sentry flamer ammo now actually applies its initial damage (~30) to non-immune xenos
balance: AMMO_ANTISTRUCT|AMMO_ANTIVEHICLE are now actually required for a vehicle damage multiplier
code: Bitwise OR mistakes like this are now linted against
/:cl:

@cmss13-ci cmss13-ci bot added Fix Fix one bug, make ten more Balance You need to be a professional veteran game maintainer to comprehend what is being done here. labels Dec 3, 2024
@Drulikar Drulikar added the Balance Approved This PR has had its balance and gameplay-affecting aspects approved. Cry to the Head-maint about it. label Dec 3, 2024
@Git-Nivrak

This comment was marked as resolved.

@cmss13-ci cmss13-ci bot added the Code Improvement Make the code longer label Dec 4, 2024
@Drulikar Drulikar added the Github We don't really know what else this belongs to label Dec 4, 2024
@harryob harryob added this pull request to the merge queue Dec 4, 2024
Merged via the queue into cmss13-devs:master with commit 184e126 Dec 4, 2024
27 checks passed
cmss13-ci bot added a commit that referenced this pull request Dec 4, 2024
@Drulikar Drulikar deleted the Fix_Bitwise_Ops branch December 4, 2024 09:57
HIDgamer pushed a commit to HIDgamer/cmss13 that referenced this pull request Dec 8, 2024
# About the pull request

This PR corrects a few bitwise ops I found using `&[^\|\(]*\|[^\|]`
because of operation order. Basically `flag & ALPHA|BRAVO` is going to
always be a truthy result (depends on the actual value for `BRAVO`)
since its resolved as `(flag & ALPHA)|BRAVO`. The fixes to matrix editor
would have already been caught by checking the admin holder. I don't
know about dropship runway. But a potentially concerning one is w/ flame
ammo.

Adds a grep lint to find ambiguous bitwise ORs like this using
`^(?:[^\/\n]|\/[^\/\n])*(&[ \t]*\w+[ \t]*\|[ \t]*\w+)` (complication
came from supporting `//` though block quotes will still trip it which
IMO is fine)

# Explain why it's good for the game

These are clear mistakes, but this may make sentry flamer ammo more
effective on non-immune xenos.

Fixes: 

![image](https://github.com/user-attachments/assets/86cab12d-c274-4848-ac04-af75715cb4ca)


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![fire](https://github.com/user-attachments/assets/824e9c72-878e-4b21-a962-a6eb78cdf7f2)

Linter:
https://github.com/cmss13-devs/cmss13/actions/runs/12153015470/job/33890398213?pr=7729#step:7:36

</details>


# Changelog
:cl: Drathek
fix: Fix code mistakes involving bitwise OR
balance: Sentry flamer ammo now actually applies its initial damage
(~30) to non-immune xenos
balance: AMMO_ANTISTRUCT|AMMO_ANTIVEHICLE are now actually required for
a vehicle damage multiplier
code: Bitwise OR mistakes like this are now linted against
/:cl:
HIDgamer pushed a commit to HIDgamer/cmss13 that referenced this pull request Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance Approved This PR has had its balance and gameplay-affecting aspects approved. Cry to the Head-maint about it. Balance You need to be a professional veteran game maintainer to comprehend what is being done here. Code Improvement Make the code longer Fix Fix one bug, make ten more Github We don't really know what else this belongs to
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants