You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was trying to fix my plugin I noticed that since last Rocket and Unturned update on 5th March OnPlayerDeath and OnPlayerDied events are called at the same time (they replicate Unturned native PlayerLife.onPlayerDied event).
Before this update OnPlayerDeath (tellDeath) was always called before OnPlayerDied (tellDied), so we could access player inventory before it was dropped (tellDead triggers PlayerLife.onLifeUpdated event which is used then by PlayerInventory to clear items when player dies).
This causes all plugins that look through player inventory when he died stop working.
I think OnPlayerDeath event should be called separately from OnPlayerDied and before native onLifeUpdated event trigger. Maybe it would be a good idea to add a native event for Unturned onBeforePlayerDied, since using triggerSend is deprecated.
Hmm interesting case. tellDeath was only sent to owner for UI purposes, so it is unfortunate plugins were depending on it that way. I will add a pre-death event for this in the next update.
Hey,
When I was trying to fix my plugin I noticed that since last Rocket and Unturned update on 5th March
OnPlayerDeath
andOnPlayerDied
events are called at the same time (they replicate Unturned native PlayerLife.onPlayerDied event).Before this update OnPlayerDeath (tellDeath) was always called before OnPlayerDied (tellDied), so we could access player inventory before it was dropped (tellDead triggers PlayerLife.onLifeUpdated event which is used then by PlayerInventory to clear items when player dies).
This causes all plugins that look through player inventory when he died stop working.
I think
OnPlayerDeath
event should be called separately from OnPlayerDied and before native onLifeUpdated event trigger. Maybe it would be a good idea to add a native event for UnturnedonBeforePlayerDied
, since using triggerSend is deprecated.Legally-Distinct-Missile/Rocket.Unturned/Events/UnturnedPlayerEvents.cs
Line 186 in 7db6967
Thanks
The text was updated successfully, but these errors were encountered: