[0.16.51] on_player_driving_changed_state doesn't trigger when player died

Things that we don't consider worth fixing at this moment.
Zaflis
Filter Inserter
Filter Inserter
Posts: 519
Joined: Sun Apr 24, 2016 12:51 am
Contact:

[0.16.51] on_player_driving_changed_state doesn't trigger when player died

Post by Zaflis »

There are scenarios and custom possibilities to kill player while he is inside a vehicle. Normally the vehicle absorbs damage and has to be destroyed before player takes damage, so normal players won't ever see this. But my mod was relying on on_player_driving_changed_state event which is supposed to trigger when player enters or leaves a vehicle. To my knowledge dying in a vehicle counts as leaving it, no? ;)

But yes i used on_player_died as a workaround.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14601
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] on_player_driving_changed_state doesn't trigger when player died

Post by Rseding91 »

The event specifically doesn't fire at that point (and a few others as well like player disconnect) because trying to handle if some mod messes with the game during the event when the rest of the logic is built such that it expects mods *don't* mess with the game just isn't worth the amount of code complication.

Similar to why most events have special cases: mods break things during events that they shouldn't and either we have to handle that on our end (and slow everything down by handling it) or we just don't dispatch the event (this case).

Since there is the died event as a work around I decided to just not send the event in this case.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't fix.”