SetSparklyChestFlag's second parameter is a flags byte (0, 1, 2), not a bool
Thanks - this is already in the database: SetSparklyChestFlag's second parameter is now typed uint8_t, so there is nothing left to apply.
Callers pass three values in DL: 0054f5f2 XOR DL,DL (OBJECT_InitializeObject), 0054f3f0 and 0054fd9b MOV DL,1 (MakeRandomSparklyChest, Objects_InitFn57), and 005823c2 / 0058240d MOV DL,2 (OBJMODE_SpawnCompanionChests). The body stores DL as it is (005540c3 MOV byte ptr [ECX+0x78],DL), and the getter's callers test separate bits of that byte: 00586029 TEST AL,0x1 (OBJOP_OpenSparklyChest) and 00543478 TEST AL,0x2 (SERVER_GAME_UNIT_method). As a bool the value 2 decompiles as true and is rebuilt as MOV DL,1. Typed uint8_t, OBJMODE_SpawnCompanionChests (00582380) recompiles byte-identical with VC8 SP1 (oracle, tree 3dba660), no function lost. The type is all that changes: bIsSparklyChest is a chosen name, though a flags byte would read better as bySparkChestFlags.
Changes 1, applied together
Set prototype
win 0x005540a0signaturevoid SetSparklyChestFlag(D2UnitStrc * pUnit, bool bIsSparklyChest)→void SetSparklyChestFlag(D2UnitStrc * pUnit, uint8_t bIsSparklyChest)convention__fastcall