| 4017 | |
| 4018 | |
| 4019 | void ScriptTimer::Disable() |
| 4020 | { |
| 4021 | mEnabled = false; |
| 4022 | --g_script.mTimerEnabledCount; |
| 4023 | if (!g_script.mTimerEnabledCount && !g_nLayersNeedingTimer && !Hotkey::sJoyHotkeyCount) |
| 4024 | KILL_MAIN_TIMER |
| 4025 | // Above: If there are now no enabled timed subroutines, kill the main timer since there's no other |
| 4026 | // reason for it to exist if we're here. This is because or direct or indirect caller is |
| 4027 | // currently always ExecUntil(), which doesn't need the timer while its running except to |
| 4028 | // support timed subroutines. UPDATE: The above is faulty; Must also check g_nLayersNeedingTimer |
| 4029 | // because our caller can be one that still needs a timer as proven by this script that |
| 4030 | // hangs otherwise: |
| 4031 | //SetTimer, Test, on |
| 4032 | //Sleep, 1000 |
| 4033 | //msgbox, done |
| 4034 | //return |
| 4035 | //Test: |
| 4036 | //SetTimer, Test, off |
| 4037 | //return |
| 4038 | } |
| 4039 | |
| 4040 | |
| 4041 |
no outgoing calls
no test coverage detected