Skip to content

Commit

Permalink
added missing null check in clipmove.
Browse files Browse the repository at this point in the history
This only very rarely triggered for Blood's projectiles, no other things use this code path.
  • Loading branch information
coelckers committed Dec 20, 2023
1 parent af4eaf6 commit 485ad27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/build/src/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
DVector2 v(vec.X* inttoworld, vec.Y* inttoworld);
sectortype* sect = &sector[*sectnum];
updatesector(v, &sect, rad * inttoworld);
*sectnum = ::sectindex(sect);
if (sect != nullptr) *sectnum = ::sectindex(sect);
else *sectnum = -1;
}

pos->X = vec.X;
Expand All @@ -621,6 +622,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
if (inside(fpos.X, fpos.Y, &sector[clipsectorlist[j]]) == 1)
{
*sectnum = clipsectorlist[j];

return clipReturn;
}

Expand Down

0 comments on commit 485ad27

Please sign in to comment.