tflo / PetWalker

WoW Retail addon. Automatically restores your lost companion pet or/and periodically auto-summons a new one from a configurable pool. Can be set to work globally (same pet(s) for all alts), or per char.
GNU General Public License v3.0
3 stars 0 forks source link

Stop auto summoning while remote-controlling toys #11

Closed tflo closed 1 month ago

tflo commented 1 month ago

This was originally posted by Legolando as comment #​6679511 at https://www.curseforge.com/wow/addons/angleur/comments :

In reply to 6mot:

Well, actually there is one thing! But it's about a very niche aspect of the game most probably don't care about.

When you summon a remote-controlled toy like the Darkmoon Tonk with PetWalker enabled, the game's Event system recognizes that as you yourself moving so it tries to resummon the previous pet - and since remote toys are technically considered pets, they immediately break down after moving an inch.

As a band-aid fix to this I have added an if statement to the first line of the function like this:

function ns:PLAYER_STARTED_MOVING() if IsPossessBarVisible() then return end ns.debugprint 'Event: PLAYER_STARTED_MOVING --> autoaction' ns.autoaction() end
It works nicely from my experience but perhaps there is a better way to do it :D

Maybe this doesn't call for a patch on its own but perhaps you could include it alongside another change in the future!

tflo commented 1 month ago

Thanks for the report and suggestion!

PetWalker already has some exclusions for similar things (see the stop_auto_summon function, around line 150 in main.lua).

However, I currently exclude them by their aura ID, so the IsPossessBarVisible test seems like a smart idea to me, since it has the potential to cover a whole bunch of similar auras, including some already excluded. (At least Jerry the Snail (142372), possibly the Eye of Kilrogg aura (212754), and, yes, most likely all or many of the controller-style toys, that have been on my to-do list (for quite some time ;) ).

I will add the IsPossessBarVisible test, see which of the excluded auras can be replaced by it, and release an update soon.


(Funny thing is, I stumbled across the IsPossessBarVisible not too long ago, but had no idea what a possess bar exactly was. I came to the conclusion that it must be something combat-related, and therefore not interesting for PW, since it stops its activity during combat anyway. It didn't occur to me that it is this little toy vehicle GUI ;)

tflo commented 1 month ago

Version 2.2.1 with additional IsPossessBarVisible() test should be on CF shortly.

3 similar ones remain in place:

BTW, in all my tests – except for the Eye of Kilrogg from the quest – the PossessBar coincided with the VehicleActionBar (HasVehicleActionBar()).


@Legolando:

So that was a great suggestion you made there. It simplifies the tests a bit, and most importantly, covers a whole bunch more toys :)

If you come across other auras/situations that should be excluded, let me know.

LegolandoBloom commented 1 month ago

This was originally posted by Legolando as comment #​6679511 at https://www.curseforge.com/wow/addons/angleur/comments :

In reply to 6mot: Well, actually there is one thing! But it's about a very niche aspect of the game most probably don't care about. When you summon a remote-controlled toy like the Darkmoon Tonk with PetWalker enabled, the game's Event system recognizes that as you yourself moving so it tries to resummon the previous pet - and since remote toys are technically considered pets, they immediately break down after moving an inch. As a band-aid fix to this I have added an if statement to the first line of the function like this: function ns:PLAYER_STARTED_MOVING() if IsPossessBarVisible() then return end ns.debugprint 'Event: PLAYER_STARTED_MOVING --> autoaction' ns.autoaction() endIt works nicely from my experience but perhaps there is a better way to do it :D Maybe this doesn't call for a patch on its own but perhaps you could include it alongside another change in the future!

Hey, thank you for the quick response! I agree, CF comments is a mess. Perhaps I should make an issues page like this for my addons on github as well. If you put out a test/beta version let me know, I'd be a good tester for this since I use PetWalker and remote controlled toys very often

tflo commented 1 month ago

If you put out a test/beta version

v2.2.1 is already on CF. See my post above, where you find also details of the changes (and my tests).