mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: read WotLK periodic damage isCrit byte in SMSG_PERIODICAURALOG
The WotLK periodic damage format includes an isCrit byte after resisted (21 bytes total, not 20). Missing this byte caused parse misalignment for multi-effect periodicauralog packets. Also use the already-read isCrit on periodic heals to display critical HoT ticks distinctly.
This commit is contained in:
parent
8b7786f2b3
commit
003ad8b20c
1 changed files with 10 additions and 5 deletions
|
|
@ -4250,17 +4250,20 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
uint8_t auraType = packet.readUInt8();
|
||||
if (auraType == 3 || auraType == 89) {
|
||||
// Classic/TBC: damage(4)+school(4)+absorbed(4)+resisted(4) = 16 bytes
|
||||
// WotLK 3.3.5a: damage(4)+overkill(4)+school(4)+absorbed(4)+resisted(4) = 20 bytes
|
||||
// WotLK 3.3.5a: damage(4)+overkill(4)+school(4)+absorbed(4)+resisted(4)+isCrit(1) = 21 bytes
|
||||
const bool periodicWotlk = isActiveExpansion("wotlk");
|
||||
const size_t dotSz = periodicWotlk ? 20u : 16u;
|
||||
const size_t dotSz = periodicWotlk ? 21u : 16u;
|
||||
if (packet.getSize() - packet.getReadPos() < dotSz) break;
|
||||
uint32_t dmg = packet.readUInt32();
|
||||
if (periodicWotlk) /*uint32_t overkill=*/ packet.readUInt32();
|
||||
/*uint32_t school=*/ packet.readUInt32();
|
||||
uint32_t abs = packet.readUInt32();
|
||||
uint32_t res = packet.readUInt32();
|
||||
bool dotCrit = false;
|
||||
if (periodicWotlk) dotCrit = (packet.readUInt8() != 0);
|
||||
if (dmg > 0)
|
||||
addCombatText(CombatTextEntry::PERIODIC_DAMAGE, static_cast<int32_t>(dmg),
|
||||
addCombatText(dotCrit ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::PERIODIC_DAMAGE,
|
||||
static_cast<int32_t>(dmg),
|
||||
spellId, isPlayerCaster, 0, casterGuid, victimGuid);
|
||||
if (abs > 0)
|
||||
addCombatText(CombatTextEntry::ABSORB, static_cast<int32_t>(abs),
|
||||
|
|
@ -4278,11 +4281,13 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
/*uint32_t max=*/ packet.readUInt32();
|
||||
/*uint32_t over=*/ packet.readUInt32();
|
||||
uint32_t hotAbs = 0;
|
||||
bool hotCrit = false;
|
||||
if (healWotlk) {
|
||||
hotAbs = packet.readUInt32();
|
||||
/*uint8_t isCrit=*/ packet.readUInt8();
|
||||
hotCrit = (packet.readUInt8() != 0);
|
||||
}
|
||||
addCombatText(CombatTextEntry::PERIODIC_HEAL, static_cast<int32_t>(heal),
|
||||
addCombatText(hotCrit ? CombatTextEntry::CRIT_HEAL : CombatTextEntry::PERIODIC_HEAL,
|
||||
static_cast<int32_t>(heal),
|
||||
spellId, isPlayerCaster, 0, casterGuid, victimGuid);
|
||||
if (hotAbs > 0)
|
||||
addCombatText(CombatTextEntry::ABSORB, static_cast<int32_t>(hotAbs),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue