- fixed compilation.

This commit is contained in:
Christoph Oelckers 2022-10-26 12:18:30 +02:00
parent 14cff92624
commit 8415079e32
3 changed files with 14 additions and 14 deletions

View file

@ -175,9 +175,9 @@ CollisionBase clipmove_(DVector3& inpos, sectortype** const sect, const DVector2
if (!clip.precise)
{
*sectnum = FindSectorInSearchList(fpos, clip.search);
if (*sectnum == -1) *sectnum = FindBestSector(fpos);
DVector3 pos3(fpos, clip.pos.Z);
*sect = FindSectorInSearchList(pos3, clip.search);
if (*sect == nullptr) *sect = FindBestSector(pos3);
}
copypos();

View file

@ -1606,15 +1606,15 @@ void collectClipObjects(MoveClipper& clip, int spritemask)
//
//==========================================================================
int FindSectorInSearchList(const DVector3& pos, BFSSectorSearch& search)
sectortype* FindSectorInSearchList(const DVector3& pos, BFSSectorSearch& search)
{
search.Rewind();
while (auto sect = search.GetNext())
if (inside(pos.X, pos.Y, sect) == 1)
{
return ::sectnum(sect);
return sect;
}
return -1;
return nullptr;
}
//==========================================================================
@ -1623,9 +1623,9 @@ int FindSectorInSearchList(const DVector3& pos, BFSSectorSearch& search)
//
//==========================================================================
int FindBestSector(const DVector3& pos)
sectortype* FindBestSector(const DVector3& pos)
{
int bestnum = 1;
sectortype* bestsect = nullptr;
double bestdist = FLT_MAX;
for (int secnum = (int)sector.Size() - 1; secnum >= 0; secnum--)
{
@ -1641,7 +1641,7 @@ int FindBestSector(const DVector3& pos)
double dist = ceilz - pos.Z;
if (dist < bestdist)
{
bestnum = secnum;
bestsect = sect;
bestdist = dist;
}
}
@ -1651,18 +1651,18 @@ int FindBestSector(const DVector3& pos)
double dist = pos.Z - floorz;
if (dist < bestdist)
{
bestnum = secnum;
bestsect = sect;
bestdist = dist;
}
}
else
{
// inside sector
return secnum;
return sect;
}
}
}
return bestnum;
return bestsect;
}
//==========================================================================

View file

@ -314,8 +314,8 @@ struct MoveClipper
};
void collectClipObjects(MoveClipper& clip, int spritemask);
int FindBestSector(const DVector3& pos);
int FindSectorInSearchList(const DVector3& pos, BFSSectorSearch& search);
sectortype* FindBestSector(const DVector3& pos);
sectortype* FindSectorInSearchList(const DVector3& pos, BFSSectorSearch& search);
void PushAway(MoveClipper &clip, DVector2& pos, sectortype* sect);
void keepaway(MoveClipper& clip, DVector2& pos, ClipObject& clipo);