Skip to content

Properly initialize PackedGuid buffer#462

Merged
Ovahlord merged 3 commits intoThe-Cataclysm-Preservation-Project:masterfrom
gonzo1247:combopoints_fix
Mar 10, 2026
Merged

Properly initialize PackedGuid buffer#462
Ovahlord merged 3 commits intoThe-Cataclysm-Preservation-Project:masterfrom
gonzo1247:combopoints_fix

Conversation

@gonzo1247
Copy link
Contributor

Changes proposed:
While debugging an issue where combo points were not updated on Windows builds, it turned out that PackedGuid(ObjectGuid) did not value-initialize _packedGuid before calling Set().

On MSVC debug builds this could leave 0xCC bytes in the unused part of the buffer. When packing GUIDs with only a few non-zero bytes (e.g. in SMSG_UPDATE_COMBO_POINTS), this could lead to malformed packed GUID data being serialized.

This change value-initializes _packedGuid in the constructor and resets the buffer in Set() to ensure deterministic behavior.

The issue was only observed on Windows builds so far.

Tests performed: (Does it build, tested in-game, etc)
Compiles successfully on Windows (MSVC) and Linux.

In-game:
Tested combo point generation against training dummies. Combo points are now correctly updated on Windows builds.

@Ovahlord Ovahlord merged commit 2e6bee2 into The-Cataclysm-Preservation-Project:master Mar 10, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants