Function SuicideSleep

Line
835
Location
common.ai
Constant?
no
Type
function
Arguments
integer seconds
Returns
nothing
835
function SuicideSleep takes integer seconds returns nothing
836
    set sleep_seconds = sleep_seconds - seconds
837
    loop
838
        exitwhen seconds <= 0
839
        exitwhen allow_signal_abort and CommandsWaiting() != 0
840
841
        if seconds >= 5 then
842
            call Sleep(5)
843
            set seconds = seconds - 5
844
        else
845
            call Sleep(seconds)
846
            set seconds = 0
847
        endif
848
    endloop
849
endfunction