Quantcast PTR bug? Druids, secure GetShapeshiftForm() and _onstate - WoWInterface
 
Thread Tools Display Modes
10-13-14, 03:38 PM   #1
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
PTR bug? Secure GetShapeshiftForm() and _onstate

I'm experiencing something strange on the PTR with states and GetShapeshiftForm().

I'm using a state header and and registering something like this:

Lua Code:
  1. local tHeader = CreateFrame("Frame", "HeaderFrame", UIParent, "SecureHandlerStateTemplate")
  2. RegisterStateDriver(tHeader, 1, "[form:1/2/3/4]a;b")  
  3. tHeader:SetAttribute("_onstate-1", [[
  4.     print(newstate, GetShapeshiftForm())
  5. ]])
Testing this code with a druid on PTR does reveal this:
  • switching from normal form (0) to bear (form1) triggers the state but prints "a 0"
  • switching from normal form (0) to cat (form2) triggers the state but prints "a 0"
  • switching from normal form (0) to travel (form3) triggers the state AND prints "a 3" (as expected)
  • switching from normal form (0) to moonkin (form4) triggers the state but prints "a 0"

So, there's something broken with GetShapeshiftForm() (the secure version at least) on PTR, isn't it?
Could someone please confirm that this is not the desired behavior?

[e]
Switching directly from one form to another without taking the long way via normal form does produce totally weird and unpredictable results. The state doesn't even trigger at all. Except when switching from whatever to form:3 - where state a and b Trigger both. oO

[e]
Same with Priest and Shadowform.
Warrior returns always 1 - no matter what stance.

Last edited by Duugu : 10-13-14 at 03:53 PM.
 
10-13-14, 03:56 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
You can do this and use newstate to tell you what form you're in.
Lua Code:
  1. '[noform]0;[form:1]1;[form:2]2;[form:3]3;[form:4]4'
The issue seems to be that the form condition is firing before GetShapeshiftForm() returns information about the new form.

Switching directly between forms wouldn't do anything with your example because [form:1/2/3/4] is still true, so the state doesn't change except when your character registers as being out of form in between shifts.

Macro conditions are only evaluated every 0.5 seconds or something, so you'll have ambiguous results.

Last edited by semlar : 10-13-14 at 04:01 PM.
 
10-13-14, 04:47 PM   #3
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by semlar View Post
You can do this and use newstate to tell you what form you're in.
Lua Code:
  1. '[noform]0;[form:1]1;[form:2]2;[form:3]3;[form:4]4'
As always you're coming up with a creative solution. Thanks.

Originally Posted by semlar View Post
Switching directly between forms wouldn't do anything with your example because [form:1/2/3/4] is still true, so the state doesn't change except when your character registers as being out of form in between shifts.
On live servers it triggers. There switching like bear>cat actually is bear>normal>cat.
On PTR it seems to be bear>cat ... skipping the intermediate step to normal form. :/
 
10-13-14, 04:47 PM   #4
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 125
Originally Posted by Duugu View Post
Warrior returns always 1 - no matter what stance.
Krieger haben keine Stances mehr sondern nur noch buffs.

GetShapeshiftForm(true) ist der korrekte Befehl.
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker

Last edited by humfras : 10-13-14 at 04:49 PM.
 
10-13-14, 07:52 PM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by humfras View Post
Krieger haben keine Stances mehr sondern nur noch buffs.
Oh. Danke.

Originally Posted by humfras View Post
GetShapeshiftForm(true) ist der korrekte Befehl.
Hm. Bewirkt keine Änderung. Wo hast Du diese Info her?


What a weird hack. But at least it's working now.
 
10-14-14, 01:26 AM   #6
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 125
Originally Posted by Duugu View Post
Hm. Bewirkt keine Änderung. Wo hast Du diese Info her?
Das Argument sorgt dafür, dass Aspekte/Präsenzen/Auren ignoriert werden und nur die echten Stances angezeigt werden.
(Nur zur zusätzlichen Info )
Du solltest hier prüfen, ob das Event UPDATE_SHAPESHIFT_FORM vor oder nach dem SecureHandler triggered.


Bezüglich Krieger: Das stance-Argument funktioniert trotzdem noch.


Den SecureStateDriver solltest du am besten immer so benutzen, wie in semlar's Beispiel. Spart dir einiges an Kopfzerbrechen.
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker

Last edited by humfras : 10-14-14 at 01:37 AM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » PTR bug? Druids, secure GetShapeshiftForm() and _onstate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off