summaryrefslogtreecommitdiffstats
path: root/DTCallbackCompatibility.c
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2018-03-18 02:49:02 +0100
committerMarkus Mittendrein <git@maxmitti.tk>2018-03-18 02:49:02 +0100
commit4d0ef730585b2791a3916a47887051f07e528b75 (patch)
tree47021b45432fff305999459e760793edd328bd13 /DTCallbackCompatibility.c
parenta76ecc342fd9ac47b9349fb5e5b0b99a44cdf812 (diff)
downloadSystem.c4g-4d0ef730585b2791a3916a47887051f07e528b75.tar.gz
System.c4g-4d0ef730585b2791a3916a47887051f07e528b75.zip
DTCallback: Change order of fast and target parameter for Object/DefinitionCallback
Use DTCallbackCompatibility for backwards compatibility
Diffstat (limited to 'DTCallbackCompatibility.c')
-rw-r--r--DTCallbackCompatibility.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/DTCallbackCompatibility.c b/DTCallbackCompatibility.c
new file mode 100644
index 0000000..d408954
--- /dev/null
+++ b/DTCallbackCompatibility.c
@@ -0,0 +1,27 @@
+#strict 2
+
+// NOTE: Make sure this is loaded after DTCallback.c and overloads the original functions
+
+global func ObjectCallback(string name, targetOrFast, bool fast)
+{
+ if(GetType(targetOrFast) == C4V_C4Object)
+ {
+ return _inherited(name, fast, targetOrFast);
+ }
+ else
+ {
+ return _inherited(name, targetOrFast, fast);
+ }
+}
+
+global func DefinitionCallback(string name, targetOrFast, bool fast)
+{
+ if(GetType(targetOrFast) == C4V_C4ID)
+ {
+ return _inherited(name, fast, targetOrFast);
+ }
+ else
+ {
+ return _inherited(name, targetOrFast, fast);
+ }
+}