From 39efafbae3ee9085bb4ff8dacbe802a0e18b03ac Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Thu, 12 Jun 2025 01:49:28 -0500 Subject: [PATCH] Update mob_appearance.cpp --- zone/mob_appearance.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/mob_appearance.cpp b/zone/mob_appearance.cpp index 32feeedb6..80ce493f0 100644 --- a/zone/mob_appearance.cpp +++ b/zone/mob_appearance.cpp @@ -406,14 +406,14 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client) // we could remove all of the extra wearchanges at the expense of tracing down intermittent visual bugs over a long time auto build_key = [&](const WearChange_Struct& s) -> uint64_t { uint64_t key = 0; - key |= static_cast(s.spawn_id) << 0; // 16 bits - key |= static_cast(s.material & 0xFFF) << 16; // 12 bits - key |= static_cast(s.elite_material) << 28; // 1 bit - key |= static_cast(s.hero_forge_model & 0xFFFFF) << 29; // 20 bits - key |= static_cast(GetRace() & 0xFFFF) << 49; // 16 bits - key |= static_cast(s.wear_slot_id) << 0; // See below + key |= static_cast(s.material & 0xFFF) << 0; // 12 bits + key |= static_cast(s.elite_material) << 12; // 1 bit + key |= static_cast(s.hero_forge_model & 0xFFFFF) << 13; // 20 bits + key |= static_cast(GetRace() & 0xFFFF) << 33; // 16 bits + key |= static_cast(s.wear_slot_id & 0xFF) << 49; // 8 bits - // Use color as final XOR-based mix-in (preserves all 64 bits) + // Fold spawn_id and color into remaining entropy space via XOR + key ^= static_cast(s.spawn_id) * 0x85EBCA77C2B2AE63ull; key ^= static_cast(s.color.Color) * 0x9E3779B97F4A7C15ull; return key;