[2.0.32] Segmented units destroyed with editor do not always fire event for the head
Posted: Thu Feb 20, 2025 8:22 am
When a segmented-unit is killed by destroying its head or another segment it correctly fires defines.events.on_entity_died for the head.
When a segmented-unit is destroyed with editor by right clicking on its head, it correctly fires defines.events.script_raised_destroy. However this event does not fire for the head when destroying the unit by right clicking on one of its segments. I'm assuming this also applies to other script based removal methods.
This is inconsistent and inconvenient because there isn't a way to get a reference to the head segment when a body segment gets removed. (Required when using the unit_number to keep track of these enemies).
I'm happy to test any situation to narrow down the discrepancy if desired!
When a segmented-unit is destroyed with editor by right clicking on its head, it correctly fires defines.events.script_raised_destroy. However this event does not fire for the head when destroying the unit by right clicking on one of its segments. I'm assuming this also applies to other script based removal methods.
This is inconsistent and inconvenient because there isn't a way to get a reference to the head segment when a body segment gets removed. (Required when using the unit_number to keep track of these enemies).
I'm happy to test any situation to narrow down the discrepancy if desired!