Jump to content

RemoveBehavior on death runs too early (race condition)

Pending 1.2.11

dFxPhoeniX
dFxPhoeniX

Posted

Hi,
I’m seeing a race condition in SimpleStatus when a player dies. In OnPlayerDeath, the plugin calls:

BehaviorManager.RemoveBehavior(basePlayer.UserIDString);

This removes the StatusBehaviour/UI immediately, so another plugin (mine) that clears the player’s status in OnPlayerDeath (via SetStatus(..., 0)) often doesn’t get a chance to run/update before the behavior is removed. Result: the status UI can remain stuck/not cleared on death.

Fix: wrap the removal in NextTick:

NextTick(() => { BehaviorManager.RemoveBehavior(basePlayer.UserIDString); });

This lets other plugins finish their OnPlayerDeath logic first and prevents the UI/status from getting stuck.
Thanks!

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.5m
Total downloads
Customers
11k
Customers served
Files Sold
157.8k
Marketplace sales
Payments
3.4m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.