mobj->flags2 ^= MF2_DONTDRAW;
if (P_IsObjectOnGround(mobj))
{
P_RemoveMobj(mobj);
return;
}
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
player_t *player = mobj->target->player;
mobj->extravalue1 = 1;
player->kartstuff[k_offroad] += 2<<FRACBITS;
P_TeleportMove(mobj,
player->mo->x + P_ReturnThrustX(NULL, player->mo->angle, player->mo->radius)
+ P_ReturnThrustX(NULL, player->mo->angle+ANGLE_90, (mobj->threshold)<<FRACBITS),
player->mo->y + P_ReturnThrustY(NULL, player->mo->angle, player->mo->radius)
+ P_ReturnThrustY(NULL, player->mo->angle+ANGLE_90, (mobj->threshold)<<FRACBITS),
player->mo->z + (player->mo->height/2 * P_MobjFlip(player->mo))
+ (P_RandomRange(-abs(mobj->threshold), abs(mobj->threshold))<<FRACBITS));
mobj->threshold /= 2;
mobj->momz = 0;
if (mobj->movecount > 8*TICRATE)
{
P_KillMobj(mobj, mobj->target, mobj->target);
break;
}
if (abs(player->cmd.driftturn) > 100)
{
INT32 lastsign = 0;
if (mobj->lastlook > 0)
lastsign = 1;
else if (mobj->lastlook < 0)
lastsign = -1;
if ((player->cmd.driftturn > 0 && lastsign < 0)
|| (player->cmd.driftturn < 0 && lastsign > 0))
{
mobj->movecount += (TICRATE/2);
mobj->threshold = 16*lastsign;
S_StartSound(mobj, sfx_s1ab);
}
mobj->lastlook = player->cmd.driftturn;
}
mobj->movecount++;
}
else if (mobj->extravalue1) // lost your player somehow, DIE
{
P_KillMobj(mobj, NULL, NULL);
break;
}
else
{
if (P_IsObjectOnGround(mobj))
{
if (mobj->reactiontime)
mobj->reactiontime--;
else
{
mobj->momz = (mobj->info->speed * P_MobjFlip(mobj));
mobj->reactiontime = mobj->info->reactiontime;
}
}
}
break;