Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round counter skipping value #1

Closed
d00mw01f opened this issue Aug 15, 2017 · 2 comments
Closed

Round counter skipping value #1

d00mw01f opened this issue Aug 15, 2017 · 2 comments

Comments

@d00mw01f
Copy link

Doing Dalaran WQ Fight Night: Sir Galveston (https://wow-petguide.com/index.php?Strategy=968) with Iron Starlet in first slot.
With following script:

ability(566) [!self(#1).dead & self.round=1]
ability(459) [!self(#1).dead & self.round=2]
ability(208) [!self(#1).dead & self.round=3]
ability(459) [!self(#1).dead & self.round<=6]

On turn 4 (round=4) starlet kills enemy pet. On next turn round=6, skipping 5 value. Tested with

test(1) [self.round=1]
test(1) [self.round=2]
test(1) [self.round=3]
test(1) [self.round=4]
test(1) [self.round=5]
test(1) [self.round=6]

before each turn.
Probably caused by dead enemy pet, but it's hard to debug.

@DengSir
Copy link
Owner

DengSir commented Aug 26, 2017

Do you used multi rounds alibity?

@bloerwald
Copy link
Contributor

bloerwald commented Dec 15, 2020

I just observed this issue where round == 3, but self.round == 4. This might be a Blizzard issue though?!

OnBattleStart → [0, 0, 0]
ROUND_RESULTS(0) → [1, 1, 1]
PET_CHANGED(1) → [1, 1, 1]
PET_CHANGED(2) → [1, 1, 1]
---
ROUND_RESULTS(1) → [2, 2, 2]
---
ROUND_RESULTS(2)→ [3, 3, 3]    -- the enemy pet died, there *was* no round 3 yet!
ROUND_RESULTS(2)→ [3, 4, 4] 
PET_CHANGED(2) → [3, 4, 1]

So for some reason there was two ROUND_RESULTS when the enemy died, which leads to increasing self.round twice.

One workaround would be to check whether results for the given round were already seen and ignore the second event:

function Round:PET_BATTLE_PET_ROUND_RESULTS(_, round)
    -- for some reason, the event is fired twice if an enemy(?) pet dies,
    -- leading to increasing self.round counter twice. See issue #1.
    if round == self.rounds[0] - 1 then
        return
    end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants