Skip to content

Commit

Permalink
When drawing the blockmap debug display, do not follow the target mob…
Browse files Browse the repository at this point in the history
…j if it is outside the blockmap.
  • Loading branch information
danij committed Mar 24, 2008
1 parent 630cd8b commit 2ea654f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doomsday/engine/portable/src/p_bmap.c
Expand Up @@ -1160,10 +1160,13 @@ static void blockmapDebug(blockmap_t *blockmap, mobj_t *followMobj,
scale = bmapDebugSize / MAX_OF(theWindow->height / 100, 1);

if(followMobj)
{
// Determine the mobj's block.
P_ToBlockmapBlockIdx(blockmap, vBlock, followMobj->pos);
{ // Determine the mobj's block.
if(!P_ToBlockmapBlockIdx(blockmap, vBlock, followMobj->pos))
followMobj = NULL; // The target is outside the blockmap.
}

if(followMobj)
{
// Determine the mobj's collision blockbox.
radius = followMobj->radius + 64; // MAXRADIUS
V2_Set(start, followMobj->pos[VX] - radius, followMobj->pos[VY] - radius);
Expand Down

0 comments on commit 2ea654f

Please sign in to comment.