mobj_t *cur = mobj->hnext, *next;
UINT8 i;
for (i = 0; i < 5; i++)
{
mobj_t *debris = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SMK_ICEBLOCK_DEBRIS);
debris->angle = FixedAngle(P_RandomRange(0,360)<<FRACBITS);
P_InstaThrust(debris, debris->angle, P_RandomRange(3,18)*(FRACUNIT/4));
debris->momz = P_RandomRange(4,8)<<FRACBITS;
if (!i) // kinda hacky :V
S_StartSound(debris, sfx_s3k82);
}
while (cur && !P_MobjWasRemoved(cur))
{
next = cur->hnext;
P_RemoveMobj(cur);
cur = next;
}
P_RemoveMobj(mobj);
return;