Skip to content

Make sure global damage doesn't spawn impact effects#6842

Merged
wookieejedi merged 3 commits into
scp-fs2open:masterfrom
Kestrellius:fix-double-explosion
Jul 20, 2025
Merged

Make sure global damage doesn't spawn impact effects#6842
wookieejedi merged 3 commits into
scp-fs2open:masterfrom
Kestrellius:fix-double-explosion

Conversation

@Kestrellius

@Kestrellius Kestrellius commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

#6785 mistakenly made it so that the application of global damage, such as the damage from a missile's area of effect, spawns an impact effect, leading to situations where a weapon might spawn two impact effects. Fixing it is a simple matter of passing in an extra bool.

Resolves #6841.

@wookieejedi wookieejedi added the fix A fix for bugs, not-a-bugs, and/or regressions. label Jul 16, 2025

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a static bool global_damage variable, so you don't need the extra parameter.

@Kestrellius

Copy link
Copy Markdown
Contributor Author

Hmm.

So using that was in fact my plan at a certain point, but Lafiel pointed out that it's a globally-defined variable that was doing non-obvious things and we weren't inclined to mess with it. On the other hand, I've just looked and I think I have a handle on what it's doing now, and if I used it I wouldn't have even have to pass in an extra bool, since it's global. So maybe I will use it.

@Kestrellius

Copy link
Copy Markdown
Contributor Author

All right, made that change.

@Goober5000

Copy link
Copy Markdown
Contributor

Yeah, the static variable serves the same purpose as your parameter.

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the extra parameter is no longer used, the ship_do_damage calls should not supply the default parameter values.

@wookieejedi wookieejedi added this to the Release 25.0 milestone Jul 18, 2025
@Kestrellius

Copy link
Copy Markdown
Contributor Author

Done.

@wookieejedi wookieejedi merged commit 199c7b7 into scp-fs2open:master Jul 20, 2025
20 checks passed
@Kestrellius Kestrellius deleted the fix-double-explosion branch July 22, 2025 01:43
Kestrellius added a commit to Kestrellius/fs2open.github.com that referenced this pull request Jul 26, 2025
* check whether damage is global

* use static

* remove extraneous arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double Offset Explosion after #6785

3 participants