mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
Streamlined the minecart death handling
This commit is contained in:
parent
8e61cc6d13
commit
39deb64e4f
2 changed files with 3 additions and 3 deletions
|
@ -2607,6 +2607,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
case MT_MINECART:
|
||||
A_Scream(target);
|
||||
target->momx = target->momy = target->momz = 0;
|
||||
if (target->target && target->target->health)
|
||||
P_KillMobj(target->target, target, source, 0);
|
||||
break;
|
||||
|
||||
case MT_PLAYER:
|
||||
|
|
|
@ -10004,7 +10004,6 @@ static void P_MinecartThink(player_t *player)
|
|||
fa = (minecart->angle >> ANGLETOFINESHIFT) & FINEMASK;
|
||||
if (!P_TryMove(minecart, minecart->x + FINECOSINE(fa), minecart->y + FINESINE(fa), true))
|
||||
{
|
||||
P_KillMobj(player->mo, NULL, NULL, 0);
|
||||
P_KillMobj(minecart, NULL, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -10041,7 +10040,7 @@ static void P_MinecartThink(player_t *player)
|
|||
|
||||
if (!axis)
|
||||
{
|
||||
P_KillMobj(player->mo, NULL, NULL, 0);
|
||||
P_KillMobj(minecart, NULL, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -10152,7 +10151,6 @@ static void P_MinecartThink(player_t *player)
|
|||
if ((P_IsObjectOnGround(minecart) && minecart->movefactor >= 5) // off rail
|
||||
|| (abs(minecart->momx) < minecart->scale/2 && abs(minecart->momy) < minecart->scale/2)) // hit a wall
|
||||
{
|
||||
P_KillMobj(player->mo, NULL, NULL, 0);
|
||||
P_KillMobj(minecart, NULL, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue