Skip to content

fix: match upstream OnPlayerResurrect signature (bool& applySickness)#63

Open
SI-ChrisL wants to merge 1 commit into
ZhengPeiRu21:masterfrom
SI-ChrisL:fix/onplayerresurrect-hook-signature
Open

fix: match upstream OnPlayerResurrect signature (bool& applySickness)#63
SI-ChrisL wants to merge 1 commit into
ZhengPeiRu21:masterfrom
SI-ChrisL:fix/onplayerresurrect-hook-signature

Conversation

@SI-ChrisL
Copy link
Copy Markdown

Summary

  • Match upstream PlayerScript::OnPlayerResurrect signature by taking the applySickness parameter by reference (bool&) in both ChallengeMode_Hardcore and ChallengeMode_IronMan.

Why

AzerothCore's PlayerScript::OnPlayerResurrect is declared as:
virtual void OnPlayerResurrect(Player*, float, bool& applySickness)
(see src/server/game/Scripting/ScriptDefines/PlayerScript.h).

This module's overrides used bool applySickness (by value), so the override specifier's signature didn't match the virtual base. The function was added as a separate non-overriding member, the base's empty implementation was used at hook dispatch, and the resurrection behavior for Hardcore / Iron Man challenge modes silently never fired.

Test plan

  • Build the module against current AzerothCore master.
  • In-game: enable Hardcore mode, die, accept resurrection, verify the challenge-mode logic in OnPlayerResurrect runs (e.g. character is marked dead via HARDCORE_DEAD / spirit healer flow takes effect).
  • Same verification for Iron Man mode.

AzerothCore's PlayerScript::OnPlayerResurrect declares the third
parameter as `bool& applySickness` (pass-by-reference). This module's
overrides used `bool applySickness` (pass-by-value), so the signatures
didn't match and the `override` specifier silently failed to bind to
the virtual base — meaning the hook never actually fired for Hardcore
or Iron Man challenge modes.

Update both ChallengeMode_Hardcore and ChallengeMode_IronMan to take
the parameter by reference, matching ScriptDefines/PlayerScript.h.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant