diff --git a/src/p_mobj.c b/src/p_mobj.c index 3000c66740c7e1e204559322fb4a9eea6b566633..8e757f3f960461d4905503a62be872eb5d8b739e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1120,7 +1120,10 @@ fixed_t P_MobjFloorZ(sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) +// if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) +// return P_GetSlopeZAt(slope, testx, testy); + + if (R_PointInSubsector(testx, testy)->sector == boundsec ? boundsec : sector) return P_GetSlopeZAt(slope, testx, testy); // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point @@ -1196,7 +1199,10 @@ fixed_t P_MobjCeilingZ(sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) +// if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) +// return P_GetSlopeZAt(slope, testx, testy); + + if (R_PointInSubsector(testx, testy)->sector == boundsec ? boundsec : sector) return P_GetSlopeZAt(slope, testx, testy); // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point @@ -2173,8 +2179,8 @@ boolean P_CheckDeathPitCollide(mobj_t *mo) if (mo->player && mo->player->pflags & PF_GODMODE) return false; - fixed_t sectorFloor = P_MobjFloorZ(mo->subsector->sector, NULL, mo->x, mo->y, mo->radius, NULL, false, false); - fixed_t sectorCeiling = P_MobjCeilingZ(mo->subsector->sector, NULL, mo->x, mo->y, mo->radius, NULL, true, false); + fixed_t sectorFloor = P_MobjFloorZ(mo->subsector->sector, mo->subsector->sector, mo->x, mo->y, mo->radius, NULL, false, true); + fixed_t sectorCeiling = P_MobjCeilingZ(mo->subsector->sector, mo->subsector->sector, mo->x, mo->y, mo->radius, NULL, true, true); if (((mo->z <= sectorFloor && ((mo->subsector->sector->flags & MSF_TRIGGERSPECIAL_HEADBUMP) || !(mo->eflags & MFE_VERTICALFLIP)) && (mo->subsector->sector->flags & MSF_FLIPSPECIAL_FLOOR)) diff --git a/src/r_main.c b/src/r_main.c index aaab234ad1f168f2df77d2ed55b430b5cc3ff6fa..5a0903467578d15dd9f15cd37fa359efdf1ab228 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1020,6 +1020,8 @@ void R_Init(void) // // R_IsPointInSector // +// TODO: THIS FUNCTION IS BROKEN, WILL RETURN FALSE FOR POINTS OBVIOUSLY INSIDE A SECTOR +// boolean R_IsPointInSector(sector_t *sector, fixed_t x, fixed_t y) { size_t i;