Let player kill shootable objects if player can punt

This commit is contained in:
James R 2023-12-03 16:11:29 -08:00
parent 6a94d8cfa2
commit 38d9875d4c
2 changed files with 13 additions and 1 deletions

View file

@ -1233,7 +1233,8 @@ void K_PuntHazard(mobj_t *t1, mobj_t *t2)
boolean K_PuntCollide(mobj_t *t1, mobj_t *t2)
{
if (t1->flags & MF_DONTPUNT)
// MF_SHOOTABLE will get damaged directly, instead
if (t1->flags & (MF_DONTPUNT | MF_SHOOTABLE))
{
return false;
}

View file

@ -1616,6 +1616,17 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
K_KartBouncing(tm.thing, thing);
return BMIT_CONTINUE;
}
else if ((thing->flags & MF_SHOOTABLE) && K_PlayerCanPunt(tm.thing->player))
{
// see if it went over / under
if (tm.thing->z > thing->z + thing->height)
return BMIT_CONTINUE; // overhead
if (tm.thing->z + tm.thing->height < thing->z)
return BMIT_CONTINUE; // underneath
P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_NORMAL);
return BMIT_CONTINUE;
}
else if (thing->flags & MF_SOLID)
{
// see if it went over / under