Repository navigation
fix(entity): keep variant fields a metadata update leaves out - #70
Merged
notchyves merged 1 commit intoNov 6, 2026
Merged
Conversation
An actor data update carrying only VARIANT reset MARK_VARIANT and COLOR to 0. Servers resend only what changed, so models that pick their texture from query.mark_variant switched to index 0 a few seconds after joining: every game hologram on a Hive hub showed Build Battle. SetVariant now takes optional fields and only writes the ones the packet sent.
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.
Problem
On a Hive hub, every game hologram switches to Build Battle a few seconds after joining. For example, the Sky Solo NPC shows "Build Battle" above it.
Cause
The holograms (
hivehub:game_hologram) pick their name texture withquery.mark_variant, and index 0 is Build Battle. The server sends the rightMARK_VARIANTinadd_entity. Its later player-count updates (set_entity_data, every ~5 s) only carryVARIANT.ApplyMetadatathen called:Every field the packet left out was still at its
-1sentinel, somax(-1, 0)wrote0intomarkVariantandcolor. Metadata updates are partial: a field that is not sent keeps its value.Change
EntityTracker::SetVarianttakesstd::optional<int>for variant, mark variant and color, and only writes the fields that are set.ApplyMetadatacollects the three as optionals and still clamps the values it actually received to>= 0.Testing