From a5c6a7ecebee65371a123cc15cb8a0bec2a85476 Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 12 Jul 2023 02:06:40 +0200 Subject: [PATCH] added objecadded object_is_valid --- src/corelib/object.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/object.h b/src/corelib/object.h index 9d26ab9..913b670 100644 --- a/src/corelib/object.h +++ b/src/corelib/object.h @@ -24,5 +24,9 @@ struct object_t { object_t object_default(); void object_draw_sprite(object_t* object); +static inline +int object_is_valid(object_t* object) { + return object != NULL || object->active <= 0; +} -#endif /* _object_h */ \ No newline at end of file +#endif /* _object_h */