mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 12:04:38 -04:00
parent
0084c53cb9
commit
edff9efc98
@ -431,6 +431,13 @@ void R_Init (void)
|
|||||||
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
|
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
|
||||||
{
|
{
|
||||||
int nodenum = numnodes-1;
|
int nodenum = numnodes-1;
|
||||||
|
|
||||||
|
// [FG] fix crash when loading trivial single subsector maps
|
||||||
|
if (!numnodes)
|
||||||
|
{
|
||||||
|
return subsectors;
|
||||||
|
}
|
||||||
|
|
||||||
while (!(nodenum & NF_SUBSECTOR))
|
while (!(nodenum & NF_SUBSECTOR))
|
||||||
nodenum = nodes[nodenum].children[R_PointOnSide(x, y, nodes+nodenum)];
|
nodenum = nodes[nodenum].children[R_PointOnSide(x, y, nodes+nodenum)];
|
||||||
return &subsectors[nodenum & ~NF_SUBSECTOR];
|
return &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user