- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for

missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
  from being thrusted while taking damage. (Non-players were already
  unthrusted.)


SVN r1695 (trunk)
This commit is contained in:
Randy Heit 2009-06-30 23:23:12 +00:00
commit f2b7417020
8 changed files with 43 additions and 11 deletions

View file

@ -916,18 +916,20 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
}
if ((target->flags2 & MF2_INVULNERABLE) && damage < 1000000 && !(flags & DMG_FORCED))
{ // actor is invulnerable
if (!target->player)
if (target->player == NULL)
{
if (!inflictor || !(inflictor->flags3 & MF3_FOILINVUL))
if (inflictor == NULL || !(inflictor->flags3 & MF3_FOILINVUL))
{
return;
}
}
else
{
// Only in Hexen invulnerable players are excluded from getting
// thrust by damage.
if (gameinfo.gametype == GAME_Hexen) return;
// Players are optionally excluded from getting thrust by damage.
if (static_cast<APlayerPawn *>(target)->PlayerFlags & PPF_NOTHRUSTWHENINVUL)
{
return;
}
}
}
@ -1024,7 +1026,8 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
if (inflictor && inflictor != target // [RH] Not if hurting own self
&& !(target->flags & MF_NOCLIP)
&& !(inflictor->flags2 & MF2_NODMGTHRUST)
&& !(flags & DMG_THRUSTLESS))
&& !(flags & DMG_THRUSTLESS)
&& (source == NULL || source->player == NULL || !(source->flags2 & MF2_NODMGTHRUST)))
{
int kickback;