[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.
Post Reply
Zaflis
Fast Inserter
Fast Inserter
Posts: 191
Joined: Sun Apr 24, 2016 12:51 am

[0.16.51] on_player_driving_changed_state doesn't trigger when player died

Post by Zaflis » Thu Dec 06, 2018 12:23 pm

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: 7977
Joined: Wed Jun 11, 2014 5:23 am

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

Post by Rseding91 » Thu Dec 06, 2018 4:39 pm

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 IRC and Discord.

Post Reply

Return to “Won't fix.”