Repository navigation
Fix water staying invisible across dimensions - #5141
Merged
FileEX merged 1 commit intoAug 5, 2026
Merged
Conversation
FileEX
requested changes
Aug 4, 2026
FileEX
approved these changes
Aug 5, 2026
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.
Summary
Fixes water elements created in a dimension different from the local player's current dimension being deleted instead of just hidden.
Motivation
Resolves #849.
CClientWater's constructor callsRelateDimension()right away, comparing its own dimension (still the default 0, since the real value hasn't been read from the network packet yet) against the local player's current dimension. On a mismatch it callsDestroy()instead ofCreate(), leavingm_pPolynull.Packet_EntityAddtreated that as a creation failure:if (!pWater->Exists()) { delete pWater; pWater = NULL; }, deleting the element right after construction, before the packet handler even reaches the line further down that applies the water's real dimension (pEntity->SetDimension(usDimension)). That check dates back to when water had no dimension concept andm_pPoly == nullptrcould only mean the native call genuinely failed (invalid vertices, water pool full); it was never updated when dimension support was added, so it can no longer tell a real failure apart from water that's just correctly waiting for its dimension to be applied.Test plan
Created water server-side in dimension 0 while standing in dimension 1, then switched to dimension 0. Before the fix, the water never appeared; after the fix, it shows up correctly once dimensions match.
Checklist