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.
[0.16.51] on_player_driving_changed_state doesn't trigger when player died
Re: [0.16.51] on_player_driving_changed_state doesn't trigger when player died
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.
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.