Skip to content

fix: missing explicit death type when deleting a finished unit - #3310

Open
efrec wants to merge 1 commit into
beyond-all-reason:masterfrom
efrec:fix/envdamagetype-deathscriptfinished
Open

fix: missing explicit death type when deleting a finished unit#3310
efrec wants to merge 1 commit into
beyond-all-reason:masterfrom
efrec:fix/envdamagetype-deathscriptfinished

Conversation

@efrec

@efrec efrec commented Sep 1, 2026

Copy link
Copy Markdown

weaponDefID 0 is a real weapondef and not an envDamageType, but is used in CUnitHandler::QueueDeleteUnit as a fallback/default. Reaching deletion through deathScriptFinished probably should use the script kill weapon instead.

This does change what UnitDestroyed reports for some code paths, and drops the default argument on KillUnit and ForcedKillUnit, probably correct to do but needs to be careful.

weaponDefID 0 is a real weapondef and not an envDamageType, but is used in CUnitHandler::QueueDeleteUnit as a fallback/default. Reaching deletion through deathScriptFinished probably should use the script kill weapon instead.

This does change what UnitDestroyed reports for some code paths, and drops the default argument on KillUnit and ForcedKillUnit, probably correct to do but needs to be careful.
@sprunk

sprunk commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Should be a new magic value probably, something like envDamageTypes.ForceDeleted.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants