WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   PTR bug? Druids, secure GetShapeshiftForm() and _onstate (https://www.wowinterface.com/forums/showthread.php?t=50043)

Duugu 10-13-14 03:38 PM

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.

semlar 10-13-14 03:56 PM

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.

Duugu 10-13-14 04:47 PM

Quote:

Originally Posted by semlar (Post 297714)
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.

Quote:

Originally Posted by semlar (Post 297714)
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. :/

humfras 10-13-14 04:47 PM

Quote:

Originally Posted by Duugu (Post 297713)
Warrior returns always 1 - no matter what stance.

Krieger haben keine Stances mehr sondern nur noch buffs.

GetShapeshiftForm(true) ist der korrekte Befehl.

Duugu 10-13-14 07:52 PM

Quote:

Originally Posted by humfras (Post 297717)
Krieger haben keine Stances mehr sondern nur noch buffs.

Oh. Danke. :)

Quote:

Originally Posted by humfras (Post 297717)
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. :D

humfras 10-14-14 01:26 AM

Quote:

Originally Posted by Duugu (Post 297721)
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.


All times are GMT -6. The time now is 07:42 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI