Skip to content

Fix HouseRaffleStone timer cleanup#2456

Open
Alcsaar wants to merge 1 commit into
modernuo:mainfrom
Alcsaar:fix/house-raffle-stone-timer
Open

Fix HouseRaffleStone timer cleanup#2456
Alcsaar wants to merge 1 commit into
modernuo:mainfrom
Alcsaar:fix/house-raffle-stone-timer

Conversation

@Alcsaar
Copy link
Copy Markdown

@Alcsaar Alcsaar commented May 15, 2026

Summary

Fixes a NullReferenceException when deleting/removing the last active HouseRaffleStone.

AddRaffleStone() started the shared repeating raffle timer but did not assign it to _allStonesTimer. When the final tracked raffle stone was removed, RemoveRaffleStone() attempted to call _allStonesTimer.Stop(), causing a null reference.

Changes

  • Store the shared raffle timer when it is created.
  • Avoid duplicate timer registration for the same stone.
  • Stop the shared timer null-safely when the final tracked stone is removed.
  • Guard the timer tick against a null stone set.

Testing

  • Tested removing stone in game during active raffles / etc to ensure no further DCs

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