- fixed: The PathTraverse and sight checking code may not assume that ceiling(x) == floor(x)+1.
This will fail when a trace starts directly on a block boundary in which case x is a whole number. It should always use 'floor(x)+1' to ensure that the calculated point is at the right or upper edge of a block.
This commit is contained in:
parent
d4a2e9696e
commit
8cbdbdaf70
2 changed files with 4 additions and 5 deletions
|
|
@ -651,7 +651,7 @@ bool SightCheck::P_SightPathTraverse ()
|
|||
if (mapex > mapx)
|
||||
{
|
||||
mapxstep = 1;
|
||||
partialx = xs_CeilToInt(xt1) - xt1;
|
||||
partialx = 1. - xt1 + xs_FloorToInt(xt1);
|
||||
ystep = (y2 - y1) / fabs(x2 - x1);
|
||||
}
|
||||
else if (mapex < mapx)
|
||||
|
|
@ -671,7 +671,7 @@ bool SightCheck::P_SightPathTraverse ()
|
|||
if (mapey > mapy)
|
||||
{
|
||||
mapystep = 1;
|
||||
partialy = xs_CeilToInt(yt1) - yt1;
|
||||
partialy = 1. - yt1 + xs_FloorToInt(yt1);
|
||||
xstep = (x2 - x1) / fabs(y2 - y1);
|
||||
}
|
||||
else if (mapey < mapy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue