refactor: replace magic bag slot offset 19 with FIRST_BAG_EQUIP_SLOT

- Add Inventory::FIRST_BAG_EQUIP_SLOT = 19 constant with why-comment
  explaining WoW equip slot layout (bags occupy slots 19-22)
- Replace all 19 occurrences of magic number 19 in bag slot calculations
  across inventory_handler, spell_handler, inventory, and game_handler
- Add UNIT_FIELD_FLAGS / UNIT_FLAG_PVP comment in combat_handler
- Add why-comment on network packet budget constants (prevent server
  data bursts from starving the render loop)
This commit is contained in:
Kelsi 2026-03-30 14:20:39 -07:00
parent 4574d203b5
commit 28e5cd9281
7 changed files with 25 additions and 18 deletions

View file

@ -1362,6 +1362,7 @@ void CombatHandler::togglePvp() {
auto entity = owner_.getEntityManager().getEntity(owner_.playerGuid);
bool currentlyPvp = false;
if (entity) {
// UNIT_FIELD_FLAGS (index 59), bit 0x1000 = UNIT_FLAG_PVP
currentlyPvp = (entity->getField(59) & 0x00001000) != 0;
}
if (currentlyPvp) {