Function SuicideOnPlayerWave

Line
1729
Location
common.ai
Constant?
no
Type
function
Arguments
nothing
Returns
nothing
1729
function SuicideOnPlayerWave takes nothing returns nothing
1730
    call Trace("waiting for attack wave to enter combat\n") //xxx
1731
    loop
1732
        //xxx
1733
        if allow_signal_abort and CommandsWaiting() != 0 then
1734
            call Trace("ABORT -- attack wave override\n")
1735
        endif
1736
1737
        if CaptainInCombat(true) then
1738
            call Trace("done - captain has entered combat\n")
1739
        endif
1740
1741
        if CaptainIsEmpty() then
1742
            call Trace("done - all units are dead\n")
1743
        endif
1744
1745
        if sleep_seconds < -300 then
1746
            call Trace("done - timeout, took too long to reach engage the enemy\n")
1747
        endif
1748
        //xxx
1749
1750
        exitwhen allow_signal_abort and CommandsWaiting() != 0
1751
1752
        exitwhen CaptainInCombat(true)
1753
        exitwhen CaptainIsEmpty()
1754
        call SuicideSleep(10)
1755
        exitwhen sleep_seconds < -300
1756
    endloop
1757
1758
    call Trace("waiting for attack wave to die\n") //xxx
1759
    loop
1760
        //xxx
1761
        if allow_signal_abort and CommandsWaiting() != 0 then
1762
            call Trace("ABORT - attack wave override\n")
1763
        endif
1764
1765
        if CaptainIsEmpty() then
1766
            call Trace("done - all units are dead\n")
1767
        endif
1768
1769
        if sleep_seconds < -300 then
1770
            call Trace("done - timeout, took too long to reach engage the enemy\n")
1771
        endif
1772
        //xxx
1773
1774
        exitwhen allow_signal_abort and CommandsWaiting() != 0
1775
1776
        exitwhen CaptainIsEmpty()
1777
        call SuicideSleep(10)
1778
        exitwhen sleep_seconds < -300
1779
    endloop
1780
endfunction