Skip to content

Commit

Permalink
Set some flags for pathfinding.
Browse files Browse the repository at this point in the history
  • Loading branch information
num0005 committed Oct 10, 2018
1 parent 4c55be2 commit 1fe83cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion H2Codez/Common/Pathfinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ bool pathfinding::generate(scenario_structure_bsp_block *sbsp)

link->rightSector = edge->rightSurface;
link->leftSector = edge->leftSurface;
int *flags_ptr = reinterpret_cast<int*>(&link->linkFlags);
*flags_ptr = link->SectorLinkFromCollisionEdge;
if (link->rightSector != NONE && link->rightSector != NONE)
*flags_ptr |= link->SectorLinkBothSectorsWalkable;
}

tags::resize_block(&pathfinding->sectors, collision_bsp->surfaces.size);
Expand All @@ -53,7 +57,8 @@ bool pathfinding::generate(scenario_structure_bsp_block *sbsp)

sector->firstLinkdoNotSetManually = surface->firstEdge;
int *flags_ptr = reinterpret_cast<int*>(&sector->pathfindingSectorFlags);
*flags_ptr = ((surface->flags & surface->Breakable) ? sector->SectorBreakable : 0) | sector->SectorBspSource;
*flags_ptr = ((surface->flags & surface->Breakable) ? sector->SectorBreakable : 0) |
sector->SectorBspSource | sector->SectorWalkable | sector->Floor;
}
return true;
}
Expand Down

0 comments on commit 1fe83cc

Please sign in to comment.