Fix P_SetTarget crash by setting th->target to NULL first

This commit is contained in:
Monster Iestyn 2019-12-30 11:49:01 +00:00
parent 1d04001fdf
commit 7c9b1ee2cb

View file

@ -2647,6 +2647,7 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
// Set pointnum
th->pointnum = target->health;
th->target = NULL; // set to NULL first so the below doesn't go wrong
// Set the mobj as your target! -- Monster Iestyn 27/12/19
P_SetTarget(&th->target, target);