physics.h no longer depends on g_objects being public, or WORLD_NUM_OBJECTS being constant
parent
a5c6a7eceb
commit
3ed5755e52
|
@ -191,9 +191,9 @@ void solve_collision_slide(object_t* left, object_t* right) {
|
||||||
static inline
|
static inline
|
||||||
void _solve_move(object_t* this) {
|
void _solve_move(object_t* this) {
|
||||||
// loop over all objects and check collision if applicable
|
// 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
|
// get pointer to other object
|
||||||
object_t* other = g_objects + i;
|
object_t* other = world_get_object(i);
|
||||||
// check collision, return if found
|
// check collision, return if found
|
||||||
if(can_collide(other) && this != other && _collision_check(other, this)) {
|
if(can_collide(other) && this != other && _collision_check(other, this)) {
|
||||||
object_broadcast_collision(other, this);
|
object_broadcast_collision(other, this);
|
||||||
|
|
Loading…
Reference in New Issue