Skip to content

Commit

Permalink
Hexen|Debug: Added assertion to catch a crash when opening a swing door
Browse files Browse the repository at this point in the history
PO_SetDestination() is given a destination angle of -1, which is not a valid fine angle.
  • Loading branch information
skyjake committed Jun 27, 2012
1 parent b21de4a commit 4a3b633
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doomsday/plugins/jhexen/src/po_man.c
Expand Up @@ -76,10 +76,11 @@ void PO_StopSequence(Polyobj* po)
SN_StopSequence((mobj_t*) po);
}

void PO_SetDestination(Polyobj* po, coord_t dist, uint an, float speed)
void PO_SetDestination(Polyobj* po, coord_t dist, uint fineAngle, float speed)
{
po->dest[VX] = po->origin[VX] + dist * FIX2FLT(finecosine[an]);
po->dest[VY] = po->origin[VY] + dist * FIX2FLT(finesine[an]);
assert(fineAngle < FINEANGLES);
po->dest[VX] = po->origin[VX] + dist * FIX2FLT(finecosine[fineAngle]);
po->dest[VY] = po->origin[VY] + dist * FIX2FLT(finesine[fineAngle]);
po->speed = speed;
}

Expand Down

0 comments on commit 4a3b633

Please sign in to comment.