Trinket Menu doesn't swap during FD on classic era
Beastelion opened this issue ยท 3 comments
I have found a problem in TrinketMenu.lua on line 420
Old line : return IsVanillaClassic and (UnitIsDeadOrGhost("player") and not UnitIsFeignDeath("player")) or UnitIsDeadOrGhost("player")
Correction : return IsVanillaClassic and (UnitIsDeadOrGhost("player") and not UnitIsFeignDeath("player")) --or UnitIsDeadOrGhost("player")
The second condition makes the feign death check useless. It just never works with Feign Death.
I guess the second condition might have been there because of retail, but I only play era. So I can't know.
IsVanillaClassic always returns true. Let's put that apart.
Let's call UnitIsDeadOrGhost A.
Let's call UnitIsFeignDeath B.
I can assure you that part of the code is run in Vanilla. 100%.
Now let's check the condition :
(A and B) or A
A always returns true. No matter B, the second "or A" will always skip the B. So the swap doesn't work during the feign death because the game considers you are dead and doesn't swap during death. As much as I can understand your code.
I have removed the "or A" so the condition only is : (A and B) now. And while A is always true, B can be true or false.
If the function returns False at the end, then the swap works. If it returns True at the end, the swap doesn't work.