mirror of
https://github.com/zeldaret/oot.git
synced 2025-01-15 21:07:15 +00:00
Some cleanup on bgcheck waterbox y funcs
This commit is contained in:
parent
1cb00350d9
commit
403221a02b
1 changed files with 14 additions and 17 deletions
|
@ -4249,7 +4249,7 @@ s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f3
|
||||||
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
||||||
curWaterBox++) {
|
curWaterBox++) {
|
||||||
room = WATERBOX_ROOM(curWaterBox->properties);
|
room = WATERBOX_ROOM(curWaterBox->properties);
|
||||||
if (room == (u32)play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL) {
|
if (room == play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL) {
|
||||||
if (!(curWaterBox->properties & WATERBOX_FLAG_19)) {
|
if (!(curWaterBox->properties & WATERBOX_FLAG_19)) {
|
||||||
if (curWaterBox->xMin < x && x < curWaterBox->xMin + curWaterBox->xLength) {
|
if (curWaterBox->xMin < x && x < curWaterBox->xMin + curWaterBox->xLength) {
|
||||||
if (curWaterBox->zMin < z && z < curWaterBox->zMin + curWaterBox->zLength) {
|
if (curWaterBox->zMin < z && z < curWaterBox->zMin + curWaterBox->zLength) {
|
||||||
|
@ -4287,21 +4287,18 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos,
|
||||||
waterBox = &colHeader->waterBoxes[i];
|
waterBox = &colHeader->waterBoxes[i];
|
||||||
|
|
||||||
room = WATERBOX_ROOM(waterBox->properties);
|
room = WATERBOX_ROOM(waterBox->properties);
|
||||||
if (!(room == play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL)) {
|
if (room == play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL) {
|
||||||
continue;
|
if (!(waterBox->properties & WATERBOX_FLAG_19)) {
|
||||||
}
|
if (waterBox->xMin < pos->x && pos->x < waterBox->xMin + waterBox->xLength) {
|
||||||
if (waterBox->properties & WATERBOX_FLAG_19) {
|
if (waterBox->zMin < pos->z && pos->z < waterBox->zMin + waterBox->zLength) {
|
||||||
continue;
|
if (pos->y - surfaceChkDist < waterBox->ySurface &&
|
||||||
}
|
waterBox->ySurface < pos->y + surfaceChkDist) {
|
||||||
if (!(waterBox->xMin < pos->x && pos->x < waterBox->xMin + waterBox->xLength)) {
|
*outWaterBox = waterBox;
|
||||||
continue;
|
return i;
|
||||||
}
|
}
|
||||||
if (!(waterBox->zMin < pos->z && pos->z < waterBox->zMin + waterBox->zLength)) {
|
}
|
||||||
continue;
|
}
|
||||||
}
|
}
|
||||||
if (pos->y - surfaceChkDist < waterBox->ySurface && waterBox->ySurface < pos->y + surfaceChkDist) {
|
|
||||||
*outWaterBox = waterBox;
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4359,7 +4356,7 @@ s32 func_800425B0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32*
|
||||||
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
||||||
curWaterBox++) {
|
curWaterBox++) {
|
||||||
room = WATERBOX_ROOM(curWaterBox->properties);
|
room = WATERBOX_ROOM(curWaterBox->properties);
|
||||||
if ((room == (u32)play->roomCtx.curRoom.num) || (room == WATERBOX_ROOM_ALL)) {
|
if ((room == play->roomCtx.curRoom.num) || (room == WATERBOX_ROOM_ALL)) {
|
||||||
if (curWaterBox->properties & WATERBOX_FLAG_19) {
|
if (curWaterBox->properties & WATERBOX_FLAG_19) {
|
||||||
if (curWaterBox->xMin < x && x < (curWaterBox->xMin + curWaterBox->xLength)) {
|
if (curWaterBox->xMin < x && x < (curWaterBox->xMin + curWaterBox->xLength)) {
|
||||||
if (curWaterBox->zMin < z && z < (curWaterBox->zMin + curWaterBox->zLength)) {
|
if (curWaterBox->zMin < z && z < (curWaterBox->zMin + curWaterBox->zLength)) {
|
||||||
|
|
Loading…
Reference in a new issue