Fix Ender Dragon damage, End portal transition, and End Poem crash#1428
Open
itsRevela wants to merge 1 commit intosmartcmd:mainfrom
Open
Fix Ender Dragon damage, End portal transition, and End Poem crash#1428itsRevela wants to merge 1 commit intosmartcmd:mainfrom
itsRevela wants to merge 1 commit intosmartcmd:mainfrom
Conversation
Dragon melee damage: reassign sub-entity IDs to be sequential from the parent entity ID in ServerLevel::entityAdded(), so the client's offset-based ID calculation matches the server. Previously the server's smallId pool allocated non-sequential IDs, causing melee attacks to target entity IDs the server didn't recognize. End portal transition: ensure the player entity is always added to the new level when transitioning from The End, not just for non-End dimensions. The addEntity call was previously gated behind a lastDimension != 1 check that also excluded it from End exits. End Poem crash: bounds-check the WIN_GAME event's player index before accessing localplayers[], with a fallback to prevent null dereference when the server sends an out-of-range index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Changes
Previous Behavior
Root Cause
addEntitycall inPlayerList::changeDimensionwas gated behind alastDimension != 1check that excluded End-to-Overworld transitions, leaving the player as a ghost entity that caused a crash on the next interaction.WIN_GAMEevent handler indexed intolocalplayers[]using the server-assigned player index without bounds checking. On dedicated servers this index can exceedXUSER_MAX_COUNT, causing a null dereference.Fix Implementation
ServerLevel::entityAdded()now reassigns sub-entity IDs to be sequential from the parent entity ID when an entity with parts is added to the levellastDimension != 1gate so the player entity is always added to the destination level during End transitionslocalplayers[], with a fallback to the primary local playerAI Use Disclosure
Related Issues