- moved nodes into FLevelLocals.

This commit is contained in:
Christoph Oelckers 2017-03-17 01:42:37 +01:00
commit fea4079b7c
20 changed files with 164 additions and 208 deletions

View file

@ -426,7 +426,7 @@ void AActor::LinkToWorld(FLinkContext *ctx, bool spawningmapthing, sector_t *sec
if (sector == NULL)
{
if (!spawning || numgamenodes == 0)
if (!spawning)
{
sector = P_PointInSector(Pos());
}
@ -2093,6 +2093,34 @@ int P_VanillaPointOnLineSide(double x, double y, const line_t* line)
return 1; // back side
}
//==========================================================================
//
// P_PointInSubsector
//
//==========================================================================
subsector_t *P_PointInSubsector(double x, double y)
{
node_t *node;
int side;
// single subsector is a special case
if (level.gamenodes.Size() == 0)
return &level.gamesubsectors[0];
node = level.HeadGamenode();
fixed_t xx = FLOAT2FIXED(x);
fixed_t yy = FLOAT2FIXED(y);
do
{
side = R_PointOnSide(xx, yy, node);
node = (node_t *)node->children[side];
} while (!((size_t)node & 1));
return (subsector_t *)((uint8_t *)node - 1);
}
//==========================================================================
//
// Use buggy PointOnSide and fix actors that lie on
@ -2103,10 +2131,10 @@ int P_VanillaPointOnLineSide(double x, double y, const line_t* line)
sector_t *P_PointInSectorBuggy(double x, double y)
{
// single subsector is a special case
if (numgamenodes == 0)
if (level.gamenodes.Size() == 0)
return level.gamesubsectors[0].sector;
node_t *node = gamenodes + numgamenodes - 1;
auto node = level.HeadGamenode();
do
{