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

Prevent crashing when using item of "effect_on_conditions" type #68976

Merged
merged 2 commits into from
Oct 29, 2023

Conversation

lispcoc
Copy link
Contributor

@lispcoc lispcoc commented Oct 29, 2023

Summary

None

Purpose of change

When starting EoC using an item of type "effect_on_conditions", the game may crash if you consume the item with something like "u_consume_item" function

Describe the solution

This is caused by attempting to consume more charges on an item after it has been deleted.
If the item has already been erased for some reason, you can avoid the crash by not consuming charges.

Describe alternatives you've considered

Add u_consume_item to the processing of the item nre_recorder EoC.
I confirmed that even if you erase nre_recorder in EoC, it will not crash.

Testing

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Oct 29, 2023
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 29, 2023
@Maleclypse Maleclypse merged commit b47688d into CleverRaven:master Oct 29, 2023
@lispcoc lispcoc deleted the eoc_prevent_fix branch November 4, 2023 17:12
Maleclypse pushed a commit to Maleclypse/Cataclysm-DDA that referenced this pull request Nov 16, 2023
…erRaven#68976)

* Prevents crash from trying to spend charge with item cleared

* better handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants