Fix a null pointer access in Polymer mouse picking.

Specifically, it was in the "determine searchwall when aiming at floor or
ceiling" part.  Now, if prsectors[]->ceil.plane (or ->floor.plane) is NULL,
we set the searchwall to the sector's firstwall and return.

git-svn-id: https://svn.eduke32.com/eduke32@2610 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-04-14 13:04:31 +00:00
parent 4322dff22c
commit 059e8ebe52

View file

@ -1204,9 +1204,15 @@ void polymer_editorpick(void)
else
{
if (searchstat==1)
pl = &(prsectors[searchsector]->ceil.plane[0]);
pl = prsectors[searchsector]->ceil.plane;
else
pl = &(prsectors[searchsector]->floor.plane[0]);
pl = prsectors[searchsector]->floor.plane;
if (pl == NULL)
{
searchwall = sector[num].wallptr;
return;
}
t = dot3f(pl,scrv);
svcoeff = -(dot3f(pl,scr)+pl[3])/t;