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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/iuse_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5718,5 +5718,9 @@ std::optional<int> effect_on_conditons_actor::use( Character *p, item &it,
debugmsg( "Must use an activation eoc for activation. If you don't want the effect_on_condition to happen on its own (without the item's involvement), remove the recurrence min and max. Otherwise, create a non-recurring effect_on_condition for this item with its condition and effects, then have a recurring one queue it." );
}
}
// Prevents crash from trying to spend charge with item removed
if( !p->has_item( it ) ) {
return 0;
}
return 1;
}