diff options
Diffstat (limited to 'scene/2d/collision_object_2d.h')
-rw-r--r-- | scene/2d/collision_object_2d.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index d44e402e96..88429b145d 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -53,6 +53,7 @@ private: bool area = false; RID rid; + uint32_t callback_lock = 0; bool pickable = false; DisableMode disable_mode = DISABLE_MODE_REMOVE; @@ -83,6 +84,12 @@ private: void _apply_enabled(); protected: + _FORCE_INLINE_ void lock_callback() { callback_lock++; } + _FORCE_INLINE_ void unlock_callback() { + ERR_FAIL_COND(callback_lock == 0); + callback_lock--; + } + CollisionObject2D(RID p_rid, bool p_area); void _notification(int p_what); |