physics.h no longer depends on g_objects being public, or WORLD_NUM_OBJECTS being constant

pull/12/head
Sara 2023-07-12 02:07:08 +02:00
parent a5c6a7eceb
commit 3ed5755e52
1 changed files with 2 additions and 2 deletions

View File

@ -191,9 +191,9 @@ void solve_collision_slide(object_t* left, object_t* right) {
static inline
void _solve_move(object_t* this) {
// loop over all objects and check collision if applicable
for(int i = 0; i < WORLD_NUM_OBJECTS; ++i) {
for(int i = 0; i < world_num_objects(); ++i) {
// get pointer to other object
object_t* other = g_objects + i;
object_t* other = world_get_object(i);
// check collision, return if found
if(can_collide(other) && this != other && _collision_check(other, this)) {
object_broadcast_collision(other, this);