Repository navigation
Addon: [1.12.1] - Pet pull: register the pet's opener and detect a pet that cannot pull - #829
Merged
Merged
Conversation
The damage-done branch gated pet combat log rows on playerPetSummons, which is only ever filled by a live SPELL_SUMMON row and is emptied on every reinit. A pet that was already out when the addon loaded - login, /reload, a loading screen, or attaching the bot to a running session - is therefore not in it, and every point of its damage was dropped before it could reach cell 64. Measured on a live pull: six and a half seconds of the pet fighting with dmgDone=0 dmgTaken=0, and the first row arriving only once the mob reached the player and the player's own combat flag flipped. The damage-taken branch above already had the petGUID fallback; give the done branch the same one. Register kill credit there too, otherwise a mob the pet killed on its own is never queued by unitDied and its corpse is never reported as lootable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
From Wrath on, UnitAffectingCombat("player") only turns true once the mob
reaches the player and swings, so a pull the pet won seconds ago reads as "not
fighting". CombatGoal could not run, PullTargetGoal kept pressing Approach, and
at MAX_PULL_DURATION the whole pull was thrown away - clear target, turn away,
walk off.
CombatLog.PetEngaged answers the question the player's combat flag cannot: the
pet holds a live mob that blows have already been traded with. Landed damage is
the earliest honest proof - pet target alone is set by PetAttack while the pet
is still running, and ToPull is filled the moment PullTargetGoal has a target.
DamageTaken carries the mirror case, a mob that aggroes the pet first.
Recording is widened from the player's combat flag to "a pet is out", which is
what let the opener through in the first place. Not a floodgate: the addon only
pushes rows whose source or destination is the player or one of its summons.
GoapKey.incombat and .pulled now come from PlayerOrPetCombat. The user facing
InCombat requirement deliberately stays bound to the raw player flag.
Target_Combat looks like it should work here and does not - it stayed false for
every second of a live pet pull, so it never once beat the combat log to the
answer. Noted in the doc comment so it is not tried again.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pull the pet cannot make: an Imp out of mana for Firebolt stands where it is rather than closing to melee, so handing it the pull stalls until the pull timer gives up. bits3 bit 18 answers whether the pet has the power for a costed spell. Cost is the discriminator, and both obvious alternatives were measured on 3.4.x and both are dead. GetPetActionSlotUsable answers true for every slot, PET_ACTION_FOLLOW included, and stays true for Firebolt while the Imp is far too dry to cast it. autoCastAllowed does not separate them either - Blood Pact (6307) reports it exactly like Firebolt (3110). What differs is that Blood Pact is free. Costs are resolved through the existing GetSpellPowerCost abstraction, so a hunter pet's focus goes down the same path as a warlock pet's mana. The slot scan is cached on PET_BAR_UPDATE and only the UnitPower comparison is polled; with no pet it costs nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reads bits3 bit 18. Lets a profile hand the pull to the pet only while the pet can actually make it, and take the opener back when it cannot. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Warlock 1-10 gates the pet pull on PetCanPull and gives Immolate and Shadow Bolt "!Has Pet || !PetCanPull", so the player takes the opener back when the Imp runs dry instead of waiting out the pull timer. Hunter 1-10 gains the same pet pull, shaped after Hunter_66_farm_pet_pull: the pet makes it and the hunter holds its shots so aggro starts on the pet. The two Approach jobs are merged into one entry on purpose - PullTargetGoal keeps a single Approach key per sequence, so a second entry of that name is silently shadowed. Both hunter retreats use the existing KeyAction machinery rather than anything new. Interrupt is a keep-going condition, so a held backpedal is cut short the moment it stops applying: with a pet, TargetsPet and InMeleeRange - the pet has the mob, so standing in its reach only costs health and blocks shooting. BeforeCastFaceTarget aims first, since backpedalling is relative to facing. without one, TargetsMe just after a shot - kite it, and stop 500ms before the next shot is due so the reload animation is not clipped. The two are mutually exclusive by their pet, aggro and range gates. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Pull entries had been left gated on plain "Has Pet", which promised a pet pull the pet may not be able to make - out of focus it stands still rather than closing, and the pull stalls until the timer gives up. The file's own comments already described the PetCanPull behaviour, so code and comments disagreed. Now the same shape as Warlock_1_10: the pet branch needs PetCanPull, and Serpent Sting and Auto Shot take the opener back with "!Has Pet || !PetCanPull". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Night elf specific, capped at level 11 like the other blocks in this file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
LogPruned and LogLoopPeaks took the focus as a string, so the call sites had to evaluate settings.Focus.ToString() before the source-generated method could apply its own IsEnabled guard - which is exactly what the analyser flags. Taking RouteFocus directly moves the conversion inside that guard. Core is now clean in Release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A pet-led pull did not register. After the pet landed its opener the player was still not flagged as being in combat, so the bot sat on the target doing nothing until the mob walked over and swung — often 6-8 seconds later, and frequently long enough for
PullTargetGoal'sMAX_PULL_DURATIONto expire, clear the target and turn away.A second failure sat behind it: once the pet ran out of power it stopped attacking entirely. A pet with nothing to cast stands where it is rather than closing to melee, so the pull never happened at all and the bot waited out the full pull timer every time.
Root cause
Two independent bugs, both in the addon's combat log handling and both invisible from outside.
Pet damage never reached the bot.
EventHandlers.luagated the damage-done branch onplayerPetSummons[sourceGUID]. That table is only ever filled by a liveSPELL_SUMMONrow and is emptied on every reinit, so a pet that was already out when the addon loaded — login,/reload, a loading screen, or attaching the bot to a running session — was not in it and every point of its damage was discarded. The damage-taken branch immediately above already had thepetGUIDfallback; the done branch did not.Measured on a live pull:
The player's combat flag is the wrong question. From Wrath on,
UnitAffectingCombat("player")only turns true once the mob reaches the player and swings.GoapKey.incombatand.pulledboth came from it, soCombatGoalcould not run while the pet was already fighting.Changes
Addon —
Addons/DataToColor(version1.12.0→1.12.1)EventHandlers.lua: the pet damage-done branch now falls back toDataToColor.petGUID, mirroring the damage-taken branch. Kill credit is registered there too — without it a mob the pet killed on its own was never queued byunitDiedand its corpse was never reported lootable.Query.lua/BitCache.lua: newbits3bit 18, "the pet can still afford a costed attack". Slot costs are cached onPET_BAR_UPDATE; only theUnitPowercomparison is polled, and with no pet it costs nothing.Core
CombatLog.PetEngaged— the pet holds a live mob that blows have already been traded with.GoapKey.incombatand.pullednow come fromPlayerOrPetCombat().PetCanPullrequirement over the new bit.InCombatrequirement deliberately stays bound to the raw player flag, so no existing profile changes meaning.Profiles
PetCanPull, and Immolate / Shadow Bolt take the opener back with"!Has Pet || !PetCanPull".PetCanPull-gated pet pull, shaped afterHunter_66_farm_pet_pull. Also two backpedal entries built entirely from existingKeyActionmachinery: with a pet, back out of melee while the pet tanks; without one, kite between shots.Paths
1-8_NightElf_Teldrassil.json— a night-elf Bloodfeather wander route in The Oracle Glade, capped at level 11 like the other blocks in the file. Unrelated to the pet work, included here for convenience.Design notes
Why cost, and not the two obvious alternatives. Both were measured on 3.4.x and both are dead ends.
GetPetActionSlotUsablereturnstruefor every slot includingPET_ACTION_FOLLOWandPET_MODE_PASSIVE, and staystruefor Firebolt while the Imp is far too dry to cast it.autoCastAlloweddoes not separate them either — Blood Pact (6307) reports it exactly like Firebolt (3110). What actually differs is that Blood Pact is free. This is written up inQuery.lua:GetPetActionSpellCostso it is not rediscovered the hard way.Focus and mana share one path. Costs resolve through the existing
GetSpellPowerCostabstraction and compare againstUnitPower(pet, type), so a hunter pet's focus needs no special casing.Target_Combatwas tried and rejected. It looks like the natural signal — the mob's own combat flag, event-driven offUNIT_FLAGS— but it stayedfalsefor every second of a live pet pull and never once beat the combat log to the answer. Noted in thePetEngageddoc comment.Merged
Approachentry in the hunter Pull.PullTargetGoalkeeps a single Approach key per sequence (PullTargetGoal.cs:82-86, last-wins) and skips every Approach-named key in the cast loop, so a second entry of that name is silently shadowed. Both jobs live in one entry's requirements instead.No new C# for the backpedals.
PressDurationholds the key andInterruptis a keep-going condition, so the press is cut short the moment it stops applying.BeforeCastFaceTargetaims first where the retreat direction matters.Testing
Warlock 1-10 and Hunter 1-10 in Coldridge Valley / Northshire on Wrath 3.4.x. Pet pulls now register on the pet's first landed hit rather than on the mob's first melee swing; the player takes the opener back when the pet runs dry. Full solution builds clean in Release;
luac -pclean on every touched Lua file.Upgrade note
The in-game addon must be updated — the Core changes depend on
bits3bit 18 and on the repaired pet damage rows. An out-of-date addon reports bit 18 as0, which reads as "the pet cannot pull" and disables the pet-pull branch in any profile using it. BothWarlock_1_10andHunter_1-10fall back to the player's own opener in that case rather than stalling.🤖 Generated with Claude Code