Allow drop target to be picked up by whipping

and a bit of cleanup
This commit is contained in:
Eidolon 2024-11-09 20:44:40 -06:00 committed by Ashnal
parent cdc49d755b
commit b9f80f902b

View file

@ -1042,7 +1042,14 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim)
} }
else if (victim->type == MT_DROPTARGET || victim->type == MT_DROPTARGET_SHIELD) else if (victim->type == MT_DROPTARGET || victim->type == MT_DROPTARGET_SHIELD)
{ {
K_DropTargetCollide(victim, shield); if (K_TryPickMeUp(attacker, victim, true))
{
shield->hitlag = attacker->hitlag; // players hitlag is handled in K_TryPickMeUp, and we need to set for the shield too
}
else
{
K_DropTargetCollide(victim, shield);
}
return true; return true;
} }
else else
@ -1059,13 +1066,16 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim)
shield->extravalue1 = 1; shield->extravalue1 = 1;
} }
if (!K_TryPickMeUp(attackerPlayer->mo, victim, true)) if (K_TryPickMeUp(attacker, victim, true))
{
shield->hitlag = attacker->hitlag; // players hitlag is handled in K_TryPickMeUp, and we need to set for the shield too
}
else
{ {
P_DamageMobj(victim, shield, attacker, 1, DMG_NORMAL); P_DamageMobj(victim, shield, attacker, 1, DMG_NORMAL);
K_AddHitLag(attacker, attackerHitlag, false);
shield->hitlag = attacker->hitlag;
} }
K_AddHitLag(attacker, attackerHitlag, false);
shield->hitlag = attacker->hitlag;
} }
return false; return false;
} }