Quantcast

Fix ``wait'' nodes that are part of ``if'' and ``unless'' nodes.

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2013-02-01 15:11:59
Author local date 2013-02-01 15:11:59 +0000
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2013-02-01 15:11:59
Committer local date 2013-02-01 15:11:59 +0000
Commit 668ecddf163084a8958ce52a3730aad7a6cf67d7
Tree be253c9f9dd6b47b007cba2ca33f5c1958313c3e
Parent f82cc5310716cae51e11db73fb577bafb2f706fc
Fix ``wait'' nodes that are part of ``if'' and ``unless'' nodes.

Slightly change the way that the ``wait'' node is flagged by directly
setting and clearing a flag instead of fiddling with a negative/positive
priority.  This is simpler and more clear.

Only clear ``wait'' flag in elements returned from ``if'' and ``unless''.
This fixes ``wait'' to work as expected in the following example:

    {
        if Conditions()
            wait if PoolingConditions() Actions()
        MoreActions()
    }

If Conditions() is false, then treat the ``wait'' like it's not there and
fall through to MoreActions().

If Conditions() is true, then wait for ``if PoolingConditions() Actions()''
to be true and stop processing the script at that point.

Before this fix, ``wait'' was tainting the element returned by the ``if''
so that the entire group stopped processing at the wait statement,
regardless of the return value of Conditions().

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@675 d5049fe3-3747-40f7-a4b5-f36d6801af5f