summaryrefslogtreecommitdiffstats
path: root/DTCallback.c
diff options
context:
space:
mode:
Diffstat (limited to 'DTCallback.c')
-rw-r--r--DTCallback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/DTCallback.c b/DTCallback.c
index 820dfb7..f95ff92 100644
--- a/DTCallback.c
+++ b/DTCallback.c
@@ -5,7 +5,7 @@ static const CallbackTarget_Bind = -1;
static const CallbackTarget_Global = -2;
static const CallbackTarget_Scenario = -3;
-// NOTE: fast callbacks (fast = true for ObjectCallback or DefinitionCallback) use ObjectCall/DefinitionCall directly for greater performance if possible (refs = 0 and GetLength(args) <= 8 for CallA()) and thus must be real functions of the desired object/definition. safe mode is ignored for fast callbacks
+// NOTE: fast callbacks (fast = true for ObjectCallback or DefinitionCallback) use ObjectCall/DefinitionCall directly for greater performance if possible (refs == 0 and GetLength(args) <= 8 for CallA()) and thus must be real functions of the desired object/definition. safe mode is ignored for fast callbacks
global func GlobalCallback(string name) { return [CallbackTarget_Global, name]; }
global func ScenarioCallback(string name) { return [CallbackTarget_Scenario, name]; }
@@ -60,7 +60,7 @@ global func CallA(callback, args, bool safe, array refs)
var target = callback[0], function = callback[1];
- if((GetType(target) == C4V_C4Object || GetType(target) == C4V_C4ID) && GetLength(callback) == 3 && callback[2] && !refs && GetLength(args) <= 8) // fast callback
+ if((GetType(target) == C4V_C4Object || GetType(target) == C4V_C4ID) && GetLength(callback) == 3 && callback[2] && (!refs || refs == []) && GetLength(args) <= 8) // fast callback
{
if(GetType(target) == C4V_C4Object)
{