un-negated uses of object_is_valid that shouldn't be, and negated ones that should be

pull/12/head
Sara 2023-07-12 02:52:04 +02:00
parent 0698121853
commit ec50000130
1 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ int _expand_world() {
static inline static inline
size_t _find_free_object() { size_t _find_free_object() {
for(int i = 0; i < _world_objects.num; ++i) { for(int i = 0; i < _world_objects.num; ++i) {
if(object_is_valid(_world_objects.objects[i])) { if(!object_is_valid(_world_objects.objects[i])) {
return i; return i;
} }
} }
@ -73,7 +73,7 @@ object_t* instantiate_object(const object_t *original) {
void world_update() { void world_update() {
for(int i = 0; i < _world_objects.num; ++i) { for(int i = 0; i < _world_objects.num; ++i) {
object_t* object = world_get_object(i); object_t* object = world_get_object(i);
if(!object_is_valid(object) if(object_is_valid(object)
&& object->evt_update != NULL) { && object->evt_update != NULL) {
object->evt_update(object); object->evt_update(object);
} }
@ -83,7 +83,7 @@ void world_update() {
void world_draw() { void world_draw() {
for(int i = 0; i < _world_objects.num; ++i) { for(int i = 0; i < _world_objects.num; ++i) {
object_t* object = world_get_object(i); object_t* object = world_get_object(i);
if(!object_is_valid(object) if(object_is_valid(object)
&& object->evt_draw != NULL) { && object->evt_draw != NULL) {
object->evt_draw(object); object->evt_draw(object);
} }