diff --git a/src/g_hexen/a_clericstaff.cpp b/src/g_hexen/a_clericstaff.cpp index aa8b94d742..ecce09d345 100644 --- a/src/g_hexen/a_clericstaff.cpp +++ b/src/g_hexen/a_clericstaff.cpp @@ -71,22 +71,24 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck) if (linetarget) { P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, PClass::FindClass ("CStaffPuff"), false, &linetarget); - pmo->angle = R_PointToAngle2 (pmo->x, pmo->y, - linetarget->x, linetarget->y); - if (((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0))|| linetarget->flags3&MF3_ISMONSTER) - && (!(linetarget->flags2&(MF2_DORMANT+MF2_INVULNERABLE)))) + if (linetarget != NULL) { - newLife = player->health+(damage>>3); - newLife = newLife > max ? max : newLife; - if (newLife > player->health) + pmo->angle = R_PointToAngle2 (pmo->x, pmo->y, linetarget->x, linetarget->y); + if (((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0))|| linetarget->flags3&MF3_ISMONSTER) + && (!(linetarget->flags2&(MF2_DORMANT+MF2_INVULNERABLE)))) { - pmo->health = player->health = newLife; + newLife = player->health+(damage>>3); + newLife = newLife > max ? max : newLife; + if (newLife > player->health) + { + pmo->health = player->health = newLife; + } + P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain")); + } + if (weapon != NULL) + { + weapon->DepleteAmmo (weapon->bAltFire, false); } - P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain")); - } - if (weapon != NULL) - { - weapon->DepleteAmmo (weapon->bAltFire, false); } break; } @@ -95,16 +97,21 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck) if (linetarget) { P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, PClass::FindClass ("CStaffPuff"), false, &linetarget); - pmo->angle = R_PointToAngle2 (pmo->x, pmo->y, - linetarget->x, linetarget->y); - if ((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0)) || linetarget->flags3&MF3_ISMONSTER) + if (linetarget != NULL) { - newLife = player->health+(damage>>4); - newLife = newLife > max ? max : newLife; - pmo->health = player->health = newLife; - P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain")); + pmo->angle = R_PointToAngle2 (pmo->x, pmo->y, linetarget->x, linetarget->y); + if ((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0)) || linetarget->flags3&MF3_ISMONSTER) + { + newLife = player->health+(damage>>4); + newLife = newLife > max ? max : newLife; + pmo->health = player->health = newLife; + P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain")); + } + if (weapon != NULL) + { + weapon->DepleteAmmo (weapon->bAltFire, false); + } } - weapon->DepleteAmmo (weapon->bAltFire, false); break; } }