From 0a14d3f50cc1abdc06898dd1fe666e49cf97f614 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Sun, 9 Aug 2015 01:50:36 +0200 Subject: [PATCH] Fix calling timer callback in paused plugins Don't try to call the timer callback, if it's not runnable. Error wasn't reported before the exception refactoring. --- core/logic/smn_timers.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/logic/smn_timers.cpp b/core/logic/smn_timers.cpp index c7783f6b..33d3d873 100644 --- a/core/logic/smn_timers.cpp +++ b/core/logic/smn_timers.cpp @@ -133,7 +133,10 @@ ResultType TimerNatives::OnTimer(ITimer *pTimer, void *pData) { TimerInfo *pInfo = reinterpret_cast(pData); IPluginFunction *pFunc = pInfo->Hook; - cell_t res = static_cast(Pl_Continue); + if (!pFunc->IsRunnable()) + return Pl_Continue; + + cell_t res = static_cast(Pl_Continue); pFunc->PushCell(pInfo->TimerHandle); pFunc->PushCell(pInfo->UserData);