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: quickfix for bash-related crashes #4237

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

chaosvolt
Copy link
Member

Purpose of change

Fix a case of nullpointer fuckery causing random crashes. Fixes #4236

Describe the solution

In map.cpp, set map::smash_items so the part of the check that looks for zombify_into is properly nested behind an is_corpse check, to avoid the risk that get_mtype will implode over something that won't have it.

Describe alternatives you've considered

Screaming.

Testing

  1. Compiled and load-tested.
  2. Spawned in a bunch of steel targets and shot the fuck out of them with a barret, no crashes so far.
  3. Spawned in a road roller and rammed it at highway speed into a lone of hay bales, no crashes.
  4. Ran over some NPCs, ran over generated human corpses, and shot a target spot with a corpse on it with both a barret and an mk19, no crashes so far.
  5. Dropped C-4 and a mininuke on a NPCs and their bodies, also no crashes.
  6. Checked affected file for astyle.

image
image

Additional context

Lemme know if I missed any other obvious fuckups.

Checklist

@github-actions github-actions bot added the src changes related to source code. label Feb 19, 2024
@chaosvolt chaosvolt enabled auto-merge (squash) February 19, 2024 23:07
@chaosvolt chaosvolt merged commit 6cc0a80 into cataclysmbnteam:main Feb 20, 2024
13 checks passed
@chaosvolt chaosvolt deleted the fix-my-broke-weh branch February 20, 2024 00:40
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.

Destroying terrain/furniture with bullets sometime causes crash, at random
2 participants