SC_AngelScript icon indicating copy to clipboard operation
SC_AngelScript copied to clipboard

[Hook::Player::PlayerCanRespawn] &bCanRespawn does not prevent respawn

Open MrOats opened this issue 8 years ago • 1 comments

Reference Code: https://github.com/MrOats/AngelScript_SC_Plugins/releases/tag/SM_v4.0

In my plugin listed above, I left notes and ability to test trying to stay in Observer mode through setting &bCanRespawn for specific players. From what I found is that with bCanRespawn set to false, instead of when the timer counts to 0 on your screen and changes to "You can respawn now!", you are forcefully respawned with your gun not showing but able to shoot. With it set to true, it shows "You can respawn now!" and awaits for input like it should.

MrOats avatar Apr 08 '17 13:04 MrOats

This hook is called in CHalfLifeMultiplay::FPlayerCanRespawn, all code that processes player respawn logic should call g_pGameRules->FPlayerCanRespawn to verify that they can respawn first. Some refactoring may be required to ensure that all respawn logic uses the same code.

Disclaimer: info obtained through reverse engineering.

SamVanheer avatar Apr 08 '17 13:04 SamVanheer