mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
fix(combatlog): keep spell-go miss metadata
This commit is contained in:
parent
db681ec4c6
commit
23023dc140
1 changed files with 10 additions and 4 deletions
|
|
@ -16862,8 +16862,9 @@ void GameHandler::handleSpellGo(network::Packet& packet) {
|
||||||
// Clear unit cast bar when the spell lands (for any tracked unit)
|
// Clear unit cast bar when the spell lands (for any tracked unit)
|
||||||
unitCastStates_.erase(data.casterUnit);
|
unitCastStates_.erase(data.casterUnit);
|
||||||
|
|
||||||
// Show miss/dodge/parry/etc combat text when player's spells miss targets
|
// Preserve spellId and actual participants for spell-go miss results.
|
||||||
if (data.casterUnit == playerGuid && !data.missTargets.empty()) {
|
// This keeps the persistent combat log aligned with the later GUID fixes.
|
||||||
|
if (!data.missTargets.empty()) {
|
||||||
static const CombatTextEntry::Type missTypes[] = {
|
static const CombatTextEntry::Type missTypes[] = {
|
||||||
CombatTextEntry::MISS, // 0=MISS
|
CombatTextEntry::MISS, // 0=MISS
|
||||||
CombatTextEntry::DODGE, // 1=DODGE
|
CombatTextEntry::DODGE, // 1=DODGE
|
||||||
|
|
@ -16875,10 +16876,15 @@ void GameHandler::handleSpellGo(network::Packet& packet) {
|
||||||
CombatTextEntry::ABSORB, // 7=ABSORB
|
CombatTextEntry::ABSORB, // 7=ABSORB
|
||||||
CombatTextEntry::RESIST, // 8=RESIST
|
CombatTextEntry::RESIST, // 8=RESIST
|
||||||
};
|
};
|
||||||
// Show text for each miss (usually just 1 target per spell go)
|
const uint64_t spellCasterGuid = data.casterUnit != 0 ? data.casterUnit : data.casterGuid;
|
||||||
|
const bool playerIsCaster = (spellCasterGuid == playerGuid);
|
||||||
|
|
||||||
for (const auto& m : data.missTargets) {
|
for (const auto& m : data.missTargets) {
|
||||||
|
if (!playerIsCaster && m.targetGuid != playerGuid) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
CombatTextEntry::Type ct = (m.missType < 9) ? missTypes[m.missType] : CombatTextEntry::MISS;
|
CombatTextEntry::Type ct = (m.missType < 9) ? missTypes[m.missType] : CombatTextEntry::MISS;
|
||||||
addCombatText(ct, 0, 0, true);
|
addCombatText(ct, 0, data.spellId, playerIsCaster, 0, spellCasterGuid, m.targetGuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue