refactor: name GUID type and LFG role constants, add why-comments

- world_packets: name kGuidTypeMask/kGuidTypePet/kGuidTypeVehicle
  for chat receiver GUID type detection, with why-comment explaining
  WoW's bits-48-63 entity type encoding and 0xF0FF mask purpose
- lua_engine: name kRoleTank/kRoleHealer/kRoleDamager (0x02/0x04/0x08)
  for WotLK LFG role bitmask, add context on Leader bit (0x01) and
  source packets (SMSG_GROUP_LIST / SMSG_LFG_ROLE_CHECK_UPDATE)
This commit is contained in:
Kelsi 2026-03-30 15:28:18 -07:00
parent ff72d23db9
commit b39f0f3605
2 changed files with 17 additions and 6 deletions

View file

@ -696,10 +696,14 @@ static int lua_UnitGroupRolesAssigned(lua_State* L) {
const auto& pd = gh->getPartyData();
for (const auto& m : pd.members) {
if (m.guid == guid) {
// WotLK roles bitmask: 0x02=Tank, 0x04=Healer, 0x08=DPS
if (m.roles & 0x02) { lua_pushstring(L, "TANK"); return 1; }
if (m.roles & 0x04) { lua_pushstring(L, "HEALER"); return 1; }
if (m.roles & 0x08) { lua_pushstring(L, "DAMAGER"); return 1; }
// WotLK LFG roles bitmask (from SMSG_GROUP_LIST / SMSG_LFG_ROLE_CHECK_UPDATE).
// Bit 0x01 = Leader (not a combat role), 0x02 = Tank, 0x04 = Healer, 0x08 = DPS.
constexpr uint8_t kRoleTank = 0x02;
constexpr uint8_t kRoleHealer = 0x04;
constexpr uint8_t kRoleDamager = 0x08;
if (m.roles & kRoleTank) { lua_pushstring(L, "TANK"); return 1; }
if (m.roles & kRoleHealer) { lua_pushstring(L, "HEALER"); return 1; }
if (m.roles & kRoleDamager) { lua_pushstring(L, "DAMAGER"); return 1; }
break;
}
}