mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
K_BananaBallhogCollide: Handle use after deletes
- Return early if t1 was removed
- Don't call K_GetCollideAngle if t2 is removed
- Only relevant here because this is one of the few contexts that causes a pre-K_GetCollideAngle deletion, other circumstances should be fine..?
This commit is contained in:
parent
7868f21dd0
commit
bf64d7a0c1
1 changed files with 13 additions and 3 deletions
|
|
@ -113,15 +113,25 @@ boolean K_BananaBallhogCollide(mobj_t *t1, mobj_t *t2)
|
||||||
damageitem = true;
|
damageitem = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damageitem)
|
if (damageitem && P_MobjWasRemoved(t1) == false)
|
||||||
{
|
{
|
||||||
// This Item Damage
|
angle_t bounceangle;
|
||||||
angle_t bounceangle = K_GetCollideAngle(t2, t1);
|
|
||||||
|
|
||||||
|
if (P_MobjWasRemoved(t2) == false)
|
||||||
|
{
|
||||||
|
bounceangle = K_GetCollideAngle(t2, t1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bounceangle = K_MomentumAngle(t1) + ANGLE_90;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This Item Damage
|
||||||
S_StartSound(t1, t1->info->deathsound);
|
S_StartSound(t1, t1->info->deathsound);
|
||||||
P_KillMobj(t1, t2, t2, DMG_NORMAL);
|
P_KillMobj(t1, t2, t2, DMG_NORMAL);
|
||||||
|
|
||||||
P_SetObjectMomZ(t1, 24*FRACUNIT, false);
|
P_SetObjectMomZ(t1, 24*FRACUNIT, false);
|
||||||
|
|
||||||
P_InstaThrust(t1, bounceangle, 16*FRACUNIT);
|
P_InstaThrust(t1, bounceangle, 16*FRACUNIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue