diff --git a/src/g_hexen/a_clericstaff.cpp b/src/g_hexen/a_clericstaff.cpp index a5a5fdfec..964a78503 100644 --- a/src/g_hexen/a_clericstaff.cpp +++ b/src/g_hexen/a_clericstaff.cpp @@ -65,59 +65,59 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck) AWeapon *weapon = self->player->ReadyWeapon; pmo = player->mo; - damage = 20+(pr_staffcheck()&15); + damage = 20 + (pr_staffcheck() & 15); max = pmo->GetMaxHealth(); puff = PClass::FindActor("CStaffPuff"); for (i = 0; i < 3; i++) { - angle = pmo->angle+i*(ANG45/16); - slope = P_AimLineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), &linetarget, 0, ALF_CHECK3D); + angle = pmo->angle + i*(ANG45 / 16); + slope = P_AimLineAttack(pmo, angle, fixed_t(1.5*MELEERANGE), &linetarget, 0, ALF_CHECK3D); if (linetarget) { - P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, puff, false, &linetarget); + P_LineAttack(pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, puff, false, &linetarget); if (linetarget != NULL) { pmo->angle = pmo->AngleTo(linetarget); - if (((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0))|| linetarget->flags3&MF3_ISMONSTER) - && (!(linetarget->flags2&(MF2_DORMANT|MF2_INVULNERABLE)))) - { - newLife = player->health+(damage>>3); - newLife = newLife > max ? max : newLife; - if (newLife > player->health) + 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; + } if (weapon != NULL) { FState * newstate = weapon->FindState("Drain"); if (newstate != NULL) P_SetPsprite(player, ps_weapon, newstate); - } + } + } + if (weapon != NULL) + { + weapon->DepleteAmmo(weapon->bAltFire, false); } - if (weapon != NULL) - { - weapon->DepleteAmmo (weapon->bAltFire, false); - } } break; } - angle = pmo->angle-i*(ANG45/16); - slope = P_AimLineAttack (player->mo, angle, fixed_t(1.5*MELEERANGE), &linetarget, 0, ALF_CHECK3D); + angle = pmo->angle - i*(ANG45 / 16); + slope = P_AimLineAttack(player->mo, angle, fixed_t(1.5*MELEERANGE), &linetarget, 0, ALF_CHECK3D); if (linetarget) { - P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, puff, false, &linetarget); + P_LineAttack(pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, puff, false, &linetarget); if (linetarget != NULL) { pmo->angle = pmo->AngleTo(linetarget); - 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 ((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; diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index 53acad047..e3d6b7926 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -336,7 +336,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks) // [RH] Do some stuff to make this more useful outside Hexen if (self->flags4 & MF4_BOSSDEATH) { - CALL_ACTION(A_BossDeath, self); + A_BossDeath(self); } A_Unblock(self, true); diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index 8ec40736a..2aa52ae4f 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -550,10 +550,7 @@ bool P_MorphedDeath(AActor *actor, AActor **morphed, int *morphedstyle, int *mor if (realme->flags4 & MF4_BOSSDEATH) { realme->health = 0; // make sure that A_BossDeath considers it dead. - // FIXME: Use the caller's stack once the whole chain is scriptable. - VMFrameStack stack; - VMValue params[3] = { realme, realme, VMValue(NULL, ATAG_STATE) }; - stack.Call(A_BossDeath_VMPtr, params, countof(params), NULL, 0, NULL); + A_BossDeath(realme); } } fakeme->flags3 |= MF3_STAYMORPHED; // moved here from AMorphedMonster::Die() diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index a0aa24e24..334d12522 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -163,6 +163,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_ProgrammerDeath) } } // the sky change scripts are now done as special actions in MAPINFO - CALL_ACTION(A_BossDeath, self); + A_BossDeath(self); return 0; } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 63c7adad7..a3f7c0887 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -3310,7 +3310,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) // [RH] Do some stuff to make this more useful outside Hexen if (self->flags4 & MF4_BOSSDEATH) { - CALL_ACTION(A_BossDeath, self); + A_BossDeath(self); } A_Unblock(self, true);