Repository navigation
fix: decode 32 bit qangle_precise fields as three raw floats - #67
Merged
osztenkurden merged 1 commit intoSep 23, 2026
Merged
Conversation
CS2 declares CBodyComponentBaseModelEntity.m_angRotation with the qangle_precise encoder and a bit count of 32, and the server writes it as three full 32 bit floats. findDecoder returned QanglePresDecoder for every qangle_precise field, which reads a presence bit per component (3 bits for a zero angle) instead of 96 bits, so everything after the field was decoded at the wrong offset. This showed up on demos from CS2's new rush map (rush_001, build 2000913), whose conveyor belts (CFuncConveyor) use that body component, failing entity creation with "MALFORMED U64". The field layout itself is not new, it only needs a map that spawns such an entity. Only take the precise path when the bit count is not 32, so the field falls through to findQAngleDecoder, which already picks Qangle3Decoder for it (the same decoder used by the 32 bit aim punch angles).
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.
Demos from CS2's new rush map (
rush_001, build 2000913) fail during entity creation withMALFORMED U64.The conveyor belts (
CFuncConveyor) useCBodyComponentBaseModelEntity, whosem_angRotationis declared with theqangle_preciseencoder and a bit count of 32. The server writes it as three full 32-bit floats, butfindDecoderreturnedQanglePresDecoderfor everyqangle_precisefield, reading a presence bit per component (3 bits for a zero angle) instead of 96. Everything after the field was then decoded at the wrong offset.With this change, a
qangle_precisefield with 32 bits falls through tofindQAngleDecoder, which already picksQangle3Decoder(same as the 32-bit aim punch angles).2.7.0 without this change (658fe93):
entities: EntityMode.ALL-> MALFORMED U64entities: EntityMode.ALL, entityClasses: 'all'-> MALFORMED U64entityClassesdoesn't avoid it since every class is still decoded; the problem is the bit count.With this change, both modes complete, and the 3 conveyors decode sanely:
m_angRotation[0,0,0],m_flScale1,m_flTargetSpeed4096, cells (30,16,32) / (24,16,32) / (14,16,32), stablem_hModelper conveyor. Another build 2000913 demo (de_anubis) is unaffected. New unit tests check decoder selection and that exactly 96 bits are consumed; all 1024 unit tests pass.Demo for testing