diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c index 2fdbe02a2..9f363c0dd 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c @@ -329,7 +329,7 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) { OSTime first = osGetTime(); #endif s32 x = posX; - s32 y = posY + FIND_FLOOR_CEIL_BUFFER; + s32 y = posY; s32 z = posZ; *pceil = NULL; @@ -401,7 +401,7 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 register struct Surface *surf, *floor = NULL; register SurfaceType type = SURFACE_DEFAULT; register f32 height; - register s32 bufferY = (y + FIND_FLOOR_CEIL_BUFFER); + register s32 bufferY = y + FIND_FLOOR_BUFFER; // Iterate through the list of floors until there are no more floors. while (surfaceNode != NULL) { @@ -468,7 +468,7 @@ struct Surface *find_water_floor_from_list(struct SurfaceNode *surfaceNode, s32 f32 curHeight = FLOOR_LOWER_LIMIT; f32 bottomHeight = FLOOR_LOWER_LIMIT; f32 curBottomHeight = FLOOR_LOWER_LIMIT; - f32 buffer = FIND_FLOOR_CEIL_BUFFER; + f32 buffer = FIND_FLOOR_BUFFER; // Iterate through the list of water floors until there are no more water floors. // SURFACE_NEW_WATER_BOTTOM diff --git a/src/engine/surface_collision.h b/src/engine/surface_collision.h index 64610bd4b..14dea69fc 100644 --- a/src/engine/surface_collision.h +++ b/src/engine/surface_collision.h @@ -7,9 +7,9 @@ #include "config/config_world.h" -// The y coord is moved upward by this amount when finding floors and ceilings. +// The y coord is moved upward by this amount when finding floors. // Vanilla value is 78. -#define FIND_FLOOR_CEIL_BUFFER 78 +#define FIND_FLOOR_BUFFER 78 #define CELL_HEIGHT_LIMIT 20000 #define FLOOR_LOWER_LIMIT -11000 diff --git a/src/game/behaviors/coin.inc.c b/src/game/behaviors/coin.inc.c index fafa3f639..802ceda27 100644 --- a/src/game/behaviors/coin.inc.c +++ b/src/game/behaviors/coin.inc.c @@ -157,7 +157,7 @@ void bhv_coin_formation_spawned_coin_loop(void) { o->oPosY += 300.0f; cur_obj_update_floor_height(); - if (o->oPosY + FIND_FLOOR_CEIL_BUFFER < o->oFloorHeight || o->oFloorHeight < FLOOR_LOWER_LIMIT_MISC) { + if (o->oPosY + FIND_FLOOR_BUFFER < o->oFloorHeight || o->oFloorHeight < FLOOR_LOWER_LIMIT_MISC) { obj_mark_for_deletion(o); } else { o->oPosY = o->oFloorHeight;