diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index c4610c689..f5df0a4c7 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -170,9 +170,9 @@ void calcSlope(const sectortype* sec, float xpos, float ypos, float* pceilz, flo int len = wal->Length(); if (len != 0) { - float den = (wal->deltax() * (float(ypos - wal->y)) - wal->deltay() * (float(xpos - wal->x))) * (1.f / 8.f); - if (pceilz && sec->ceilingstat & CSTAT_SECTOR_SLOPE) *pceilz += (sec->ceilingheinum * den) / len; - if (pflorz && sec->floorstat & CSTAT_SECTOR_SLOPE) *pflorz += (sec->floorheinum * den) / len; + float fac = (wal->deltax() * (float(ypos - wal->y)) - wal->deltay() * (float(xpos - wal->x))) * (1.f / 256.f) / len; + if (pceilz && sec->ceilingstat & CSTAT_SECTOR_SLOPE) *pceilz += (sec->ceilingheinum * fac); + if (pflorz && sec->floorstat & CSTAT_SECTOR_SLOPE) *pflorz += (sec->floorheinum * fac); } } } diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index b8f48a6ff..19bc4dcd6 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -64,7 +64,7 @@ void walltype::calcLength() lengthflags &= ~1; point2Wall()->lengthflags &= ~2; auto d = delta(); - length = (int)sqrt(d.x * d.x + d.y * d.y) << 5; + length = (int)sqrt(d.x * d.x + d.y * d.y); } // needed for skipping over to get the map size first.