fix "Explosion processing is delayed to end of turn for explode-on-impact ammo" #1908
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "add explosion effect triggers after each explosive ammo is shot"
Purpose of change
Fixes #1904
Describe the solution
Adding a "explosion_handler::get_explosion_queue().execute();" after a projectile is shot.
(Cf additional context of the issue for more details)
I repeated the steps in the issue, shotted 5 ammoes and got 5 nice explosions, precisely one after each shot,
Describe alternatives you've considered
None for now
Testing
I repeated the steps in the issue.
I also tried some grenades but they worked fine. And I think it's not even related.
I tried to do the same by giving a weapon to a NPC, and I think it works, but he one shotted himself with it. Is it me or they don't seem to be able to shoot at more than 3 meters even with the right commands?
Additional context
About this part
"This may require some measure to prevent two executes being called on the same queue in one call stack."
I suppose we're safe, unless I'm missing something, because the explosion queue uses a singleton (the explosion queue will always be the same object), so even if it's called several times at different places in one turn, the object will always be updated between each call.