Merge branch 'char-damage-fix' into 'next'

Fix Amy and Fang being able to attack other players in MP Special Stages

See merge request STJr/SRB2!558
This commit is contained in:
James R 2019-12-26 18:18:10 -05:00
commit aa9cc6e6f2
1 changed files with 18 additions and 0 deletions

View File

@ -3426,6 +3426,24 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source)
if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super])
return;
if (!cv_friendlyfire.value)
{
if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK))
{
if (player->revitem != MT_LHRT && player->spinitem != MT_LHRT && player->thokitem != MT_LHRT) // Healers do not get to heal other healers.
{
P_SwitchShield(player, SH_PINK);
S_StartSound(player->mo, mobjinfo[MT_PITY_ICON].seesound);
}
}
if (source->player->ctfteam == player->ctfteam)
return;
}
if (inflictor->type == MT_LHRT)
return;
if (player->powers[pw_shield] || player->bot) //If One-Hit Shield
{
P_RemoveShield(player);