fix(update-fields): correct multiple wrong vanilla 1.12 indices on classic/turtle

The classic and turtle update_fields.json files had several wrong
indices that aliased fields together and misread the unit record.
Cross-referenced vmangos UpdateFields_1_12_1.h
(github.com/vmangos/core, OBJECT_END=6) and corrected:

- UNIT_FIELD_BYTES_1:        133 -> 138 (was colliding with MOUNTDISPLAYID)
- UNIT_FIELD_STAT0..STAT4:   138..142 -> 150..154 (the old slot held
                              pet fields PETNUMBER/PET_NAME_TIMESTAMP/
                              PETEXPERIENCE/PETNEXTLEVELEXP, not stats)
- UNIT_FIELD_RESISTANCES:    154 -> 155 (off by one — STAT4 lives at 154)
- UNIT_FIELD_NATIVEDISPLAYID: added (was missing) -> 132

The verified other indices (DISPLAYID=131, MOUNTDISPLAYID=133,
DYNAMIC_FLAGS=143, NPC_FLAGS=147, BYTES_0=36) all matched vmangos
and were left alone.

Practical impact on Classic/Turtle prior to this fix:
- entity_controller.cpp:548-553 read MOUNTDISPLAYID and BYTES_1 from
  the same slot — mount/dismount detection and shapeshift form
  detection would race and clobber each other.
- All STAT* readers were reading pet-related fields instead of stats,
  so character-sheet stats and stat-derived UI on Classic/Turtle
  would be wrong/zero.
- UNIT_FIELD_RESISTANCES readers got STAT4 instead of armor resist.

Python collision check after patch: no UNIT_* collisions in either
file.
This commit is contained in:
Kelsi
2026-05-15 00:55:07 -07:00
parent 09f7b127d0
commit 644cfcc8c1
3 changed files with 17 additions and 15 deletions

View File

@@ -28,7 +28,7 @@
"UNIT_FIELD_AURAFLAGS": 98,
"UNIT_FIELD_AURAS": 50,
"UNIT_FIELD_BYTES_0": 36,
"UNIT_FIELD_BYTES_1": 133,
"UNIT_FIELD_BYTES_1": 138,
"UNIT_FIELD_DISPLAYID": 131,
"UNIT_FIELD_FACTIONTEMPLATE": 35,
"UNIT_FIELD_FLAGS": 46,
@@ -37,13 +37,14 @@
"UNIT_FIELD_MAXHEALTH": 28,
"UNIT_FIELD_MAXPOWER1": 29,
"UNIT_FIELD_MOUNTDISPLAYID": 133,
"UNIT_FIELD_NATIVEDISPLAYID": 132,
"UNIT_FIELD_POWER1": 23,
"UNIT_FIELD_RESISTANCES": 154,
"UNIT_FIELD_STAT0": 138,
"UNIT_FIELD_STAT1": 139,
"UNIT_FIELD_STAT2": 140,
"UNIT_FIELD_STAT3": 141,
"UNIT_FIELD_STAT4": 142,
"UNIT_FIELD_RESISTANCES": 155,
"UNIT_FIELD_STAT0": 150,
"UNIT_FIELD_STAT1": 151,
"UNIT_FIELD_STAT2": 152,
"UNIT_FIELD_STAT3": 153,
"UNIT_FIELD_STAT4": 154,
"UNIT_FIELD_TARGET_HI": 17,
"UNIT_FIELD_TARGET_LO": 16,
"UNIT_NPC_FLAGS": 147

View File

@@ -28,7 +28,7 @@
"UNIT_FIELD_AURAFLAGS": 98,
"UNIT_FIELD_AURAS": 50,
"UNIT_FIELD_BYTES_0": 36,
"UNIT_FIELD_BYTES_1": 133,
"UNIT_FIELD_BYTES_1": 138,
"UNIT_FIELD_DISPLAYID": 131,
"UNIT_FIELD_FACTIONTEMPLATE": 35,
"UNIT_FIELD_FLAGS": 46,
@@ -37,13 +37,14 @@
"UNIT_FIELD_MAXHEALTH": 28,
"UNIT_FIELD_MAXPOWER1": 29,
"UNIT_FIELD_MOUNTDISPLAYID": 133,
"UNIT_FIELD_NATIVEDISPLAYID": 132,
"UNIT_FIELD_POWER1": 23,
"UNIT_FIELD_RESISTANCES": 154,
"UNIT_FIELD_STAT0": 138,
"UNIT_FIELD_STAT1": 139,
"UNIT_FIELD_STAT2": 140,
"UNIT_FIELD_STAT3": 141,
"UNIT_FIELD_STAT4": 142,
"UNIT_FIELD_RESISTANCES": 155,
"UNIT_FIELD_STAT0": 150,
"UNIT_FIELD_STAT1": 151,
"UNIT_FIELD_STAT2": 152,
"UNIT_FIELD_STAT3": 153,
"UNIT_FIELD_STAT4": 154,
"UNIT_FIELD_TARGET_HI": 17,
"UNIT_FIELD_TARGET_LO": 16,
"UNIT_NPC_FLAGS": 147

View File

@@ -53,7 +53,7 @@ In progress / known gaps:
- Quest GO interaction: CMSG_GAMEOBJ_USE + CMSG_LOOT sent correctly, but some AzerothCore/ChromieCraft servers don't grant quest credit for chest-type GOs (server-side limitation)
- Visual edge cases: some M2/WMO rendering gaps (some particle effects)
- Water refraction: enabled by default; srcAccessMask barrier fix (2026-03-18) resolved prior VK_ERROR_DEVICE_LOST on AMD/Mali GPUs
- Update-field table collision on classic/turtle: `Data/expansions/classic/update_fields.json` and `Data/expansions/turtle/update_fields.json` both map `UNIT_FIELD_BYTES_1` and `UNIT_FIELD_MOUNTDISPLAYID` to index 133. `entity_controller.cpp:548-553` reads both for distinct purposes (display change detection, mount/dismount, shapeshift), so they alias on Classic/Turtle and one of the two events will be misattributed. Needs canonical Mangos-Zero vanilla 1.12 value for one of the fields before patching.
- Fixed 2026-05-15: classic/turtle update-field tables had multiple wrong indices (`UNIT_FIELD_BYTES_1`=133 colliding with `UNIT_FIELD_MOUNTDISPLAYID`=133; STAT0..4 at 138..142; RESISTANCES at 154; missing NATIVEDISPLAYID). Corrected against vmangos `UpdateFields_1_12_1.h`: BYTES_1=138, STAT0..4=150..154, RESISTANCES=155, added NATIVEDISPLAYID=132.
## Where To Look