mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-11 15:23:51 +00:00
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:
parent
ff72d23db9
commit
b39f0f3605
2 changed files with 17 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue