diff --git a/src/g_hexen/a_clericmace.cpp b/src/g_hexen/a_clericmace.cpp index 9cb512286c..0e43f3df95 100644 --- a/src/g_hexen/a_clericmace.cpp +++ b/src/g_hexen/a_clericmace.cpp @@ -37,20 +37,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack) if (linetarget) { P_LineAttack (player->mo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true, &linetarget); - AdjustPlayerAngle (player->mo, linetarget); -// player->mo->angle = R_PointToAngle2(player->mo->x, -// player->mo->y, linetarget->x, linetarget->y); - goto macedone; + if (linetarget != NULL) + { + AdjustPlayerAngle (player->mo, linetarget); + goto macedone; + } } angle = player->mo->angle-i*(ANG45/16); slope = P_AimLineAttack (player->mo, angle, 2*MELEERANGE, &linetarget); if (linetarget) { P_LineAttack (player->mo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true, &linetarget); - AdjustPlayerAngle (player->mo, linetarget); -// player->mo->angle = R_PointToAngle2(player->mo->x, -// player->mo->y, linetarget->x, linetarget->y); - goto macedone; + if (linetarget != NULL) + { + AdjustPlayerAngle (player->mo, linetarget); + goto macedone; + } } } // didn't find any creatures, so try to strike any walls diff --git a/src/g_hexen/a_fighteraxe.cpp b/src/g_hexen/a_fighteraxe.cpp index 7dd5ac06e8..4223552b96 100644 --- a/src/g_hexen/a_fighteraxe.cpp +++ b/src/g_hexen/a_fighteraxe.cpp @@ -226,26 +226,32 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack) if (linetarget) { P_LineAttack (pmo, angle, AXERANGE, slope, damage, NAME_Melee, pufftype, true, &linetarget); - if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + if (linetarget != NULL) { - P_ThrustMobj (linetarget, angle, power); + if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + { + P_ThrustMobj (linetarget, angle, power); + } + AdjustPlayerAngle (pmo, linetarget); + useMana++; + goto axedone; } - AdjustPlayerAngle (pmo, linetarget); - useMana++; - goto axedone; } angle = pmo->angle-i*(ANG45/16); slope = P_AimLineAttack (pmo, angle, AXERANGE, &linetarget); if (linetarget) { P_LineAttack (pmo, angle, AXERANGE, slope, damage, NAME_Melee, pufftype, true, &linetarget); - if (linetarget->flags3&MF3_ISMONSTER) + if (linetarget != NULL) { - P_ThrustMobj (linetarget, angle, power); + if (linetarget->flags3&MF3_ISMONSTER) + { + P_ThrustMobj (linetarget, angle, power); + } + AdjustPlayerAngle (pmo, linetarget); + useMana++; + goto axedone; } - AdjustPlayerAngle (pmo, linetarget); - useMana++; - goto axedone; } } // didn't find any creatures, so try to strike any walls diff --git a/src/g_hexen/a_fighterhammer.cpp b/src/g_hexen/a_fighterhammer.cpp index ddfab12d46..85bbb3aaeb 100644 --- a/src/g_hexen/a_fighterhammer.cpp +++ b/src/g_hexen/a_fighterhammer.cpp @@ -50,26 +50,32 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack) if (linetarget) { P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true, &linetarget); - AdjustPlayerAngle(pmo, linetarget); - if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + if (linetarget != NULL) { - P_ThrustMobj (linetarget, angle, power); + AdjustPlayerAngle(pmo, linetarget); + if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + { + P_ThrustMobj (linetarget, angle, power); + } + pmo->special1 = false; // Don't throw a hammer + goto hammerdone; } - pmo->special1 = false; // Don't throw a hammer - goto hammerdone; } angle = pmo->angle-i*(ANG45/32); slope = P_AimLineAttack(pmo, angle, HAMMER_RANGE, &linetarget, 0, ALF_CHECK3D); if(linetarget) { P_LineAttack(pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true, &linetarget); - AdjustPlayerAngle(pmo, linetarget); - if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + if (linetarget != NULL) { - P_ThrustMobj(linetarget, angle, power); + AdjustPlayerAngle(pmo, linetarget); + if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + { + P_ThrustMobj(linetarget, angle, power); + } + pmo->special1 = false; // Don't throw a hammer + goto hammerdone; } - pmo->special1 = false; // Don't throw a hammer - goto hammerdone; } } // didn't find any targets in meleerange, so set to throw out a hammer diff --git a/src/g_hexen/a_fighterplayer.cpp b/src/g_hexen/a_fighterplayer.cpp index 078a063e03..0867a86e4b 100644 --- a/src/g_hexen/a_fighterplayer.cpp +++ b/src/g_hexen/a_fighterplayer.cpp @@ -166,12 +166,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack) pufftype = PClass::FindClass ("HammerPuff"); } P_LineAttack (pmo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, pufftype, true, &linetarget); - if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + if (linetarget != NULL) { - P_ThrustMobj (linetarget, angle, power); + if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + { + P_ThrustMobj (linetarget, angle, power); + } + AdjustPlayerAngle (pmo, linetarget); + goto punchdone; } - AdjustPlayerAngle (pmo, linetarget); - goto punchdone; } angle = pmo->angle-i * (ANG45/16); slope = P_AimLineAttack (pmo, angle, 2*MELEERANGE, &linetarget); @@ -185,12 +188,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack) pufftype = PClass::FindClass ("HammerPuff"); } P_LineAttack (pmo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, pufftype, true, &linetarget); - if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + if (linetarget != NULL) { - P_ThrustMobj (linetarget, angle, power); + if (linetarget->flags3&MF3_ISMONSTER || linetarget->player) + { + P_ThrustMobj (linetarget, angle, power); + } + AdjustPlayerAngle (pmo, linetarget); + goto punchdone; } - AdjustPlayerAngle (pmo, linetarget); - goto punchdone; } } // didn't find any creatures, so try to strike any walls