mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-21 23:40:48 +00:00
- updatesector interface cleanup.
This commit is contained in:
parent
3c72eb43f9
commit
b72283e9cb
3 changed files with 20 additions and 10 deletions
|
@ -221,16 +221,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
if (!clip.precise)
|
||||
{
|
||||
DVector3 fpos(pos->X* inttoworld, pos->Y* inttoworld, pos->Z* inttoworld);
|
||||
|
||||
clip.search.Rewind();
|
||||
while (auto sect = clip.search.GetNext())
|
||||
if (inside(fpos.X, fpos.Y, sect) == 1)
|
||||
{
|
||||
*sectnum = ::sectnum(sect);
|
||||
return clipReturn;
|
||||
}
|
||||
|
||||
*sectnum = FindBestSector(fpos);
|
||||
*sectnum = FindSectorInSearchList(fpos, clip.search);
|
||||
if (*sectnum == -1) *sectnum = FindBestSector(fpos);
|
||||
}
|
||||
|
||||
return clipReturn;
|
||||
|
|
|
@ -1606,6 +1606,23 @@ void collectClipObjects(MoveClipper& clip, int spritemask)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
int 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 -1;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FindBestSector(const DVector3& pos)
|
||||
{
|
||||
int bestnum = 1;
|
||||
|
|
|
@ -313,6 +313,7 @@ struct MoveClipper
|
|||
|
||||
void collectClipObjects(MoveClipper& clip, int spritemask);
|
||||
int FindBestSector(const DVector3& pos);
|
||||
int FindSectorInSearchList(const DVector3& pos, BFSSectorSearch& search);
|
||||
|
||||
int FindBestSector(const DVector3& pos);
|
||||
|
||||
|
|
Loading…
Reference in a new issue