rendering examples to demonstrate current issues with pre/post events #9674
+157
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok these are a little contrived but I hope they illustrate the problem mentioned in #9118
If you want to hard crash the client, set RaiseHeightClient#DO_RAISE to true
However, I've included a non-crashing version of the bug as well, this is the one that is defaulted to on. The DoublerClient pre event simply performs some additional rendering in the pre event (in this case I'm literally just rerendering the pig but imagine it as something less contrived). This event is properly attempting to handle cancellation but due to priority ordering it will still run. This will result in rendering only the doubled pig instead of 2 pigs as the original rendering will be cancelled.
You can turn CancelTestPigMod#DO_CANCEL to false if you want to see what rendering looks like in the 'intended' way in either of these examples.