Add is_instance_valid() method to GDScript, ending more than a decade of pain.

This commit is contained in:
Juan Linietsky
2018-05-07 17:30:03 -03:00
parent 80b9edf0f6
commit ff1e7cfbf4
4 changed files with 18 additions and 10 deletions

View File

@ -762,15 +762,10 @@ public:
static void debug_objects(DebugFunc p_func);
static int get_object_count();
#ifdef DEBUG_ENABLED
_FORCE_INLINE_ static bool instance_validate(Object *p_ptr) {
return instance_checks.has(p_ptr);
}
#else
_FORCE_INLINE_ static bool instance_validate(Object *p_ptr) { return true; }
#endif
};
//needed by macros