diff options
Diffstat (limited to 'DTScopedVars.c')
| -rw-r--r-- | DTScopedVars.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/DTScopedVars.c b/DTScopedVars.c index f64ccdc..0cde670 100644 --- a/DTScopedVars.c +++ b/DTScopedVars.c @@ -1,5 +1,4 @@ #strict 2 - // TODO: ScopedVars with temporary target (like a reference to a function local var) static const ScopedVar_Global = 1; @@ -49,11 +48,22 @@ global func &ScopedVar(array variable) } else { - return ScopedVar(CustomScopedVar(variable)); + if(this) + { + return ScopedVar(this->~CustomScopedVar(variable)); + } + else if(GetID()) + { + return ScopedVar(GetID()->~CustomScopedVar(variable)); + } + else + { + return ScopedVar(CustomScopedVar(variable)); + } } } -global func &CustomScopedVar() { return _inherited(...); } // this allows "overloading" this function even if the "overloading" function is loaded before +global func CustomScopedVar() { return _inherited(...); } // this allows "overloading" this function even if the "overloading" function is loaded before global func CheckScopedVar(array variable) { @@ -81,7 +91,18 @@ global func CheckScopedVar(array variable) } } - return CheckCustomScopedVar(variable); + if(this) + { + return this->~CheckCustomScopedVar(variable); + } + else if(GetID()) + { + return GetID()->~CheckCustomScopedVar(variable); + } + else + { + return CheckCustomScopedVar(variable); + } } -global func CheckCustomScopedVar() { return _inherited(...); } +global func CheckCustomScopedVar() { return _inherited(...); }
\ No newline at end of file |
