un-negated uses of object_is_valid that shouldn't be, and negated ones that should be
parent
0698121853
commit
ec50000130
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue