Compare commits

...

2 Commits

2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ 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;
return object != NULL && object->active <= 0;
}
#endif /* _object_h */

View File

@ -64,7 +64,7 @@ object_t* instantiate_object(const object_t *original) {
}
void world_update() {
for(int i = 0; i < world_num_objects(); ++i) {
for(int i = 0; i < _world_objects.num; ++i) {
object_t* object = world_get_object(i);
if(!object_is_valid(object)
&& object->evt_update != NULL) {
@ -74,7 +74,7 @@ void world_update() {
}
void world_draw() {
for(int i = 0; i < world_num_objects(); ++i) {
for(int i = 0; i < _world_objects.num; ++i) {
object_t* object = world_get_object(i);
if(!object_is_valid(object)
&& object->evt_draw != NULL) {