diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 92663c9c2..489e1365f 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,14 @@ July 16, 2006 (Changes by Graf Zahl) +- Fixed: The check for no skill menu was incorrect when a custom player + class menu was present so instead of starting the game specific skill menu + it always started Hexen's. +- Fixed: When a non-player tried to play a player sound it tried to access + the actor object as an APlayerPawn. +- Changed PlayAttacking2 to always use the melee state instead of different + implementations per player and hard coding it to MissileState+1. Also + changed PlayAttacking for the HereticPlayer to use the same animation as + PlayAttacking2. Now the special handling for Heretic in the FireWeapon + functions can be removed. - Fixed: PlayerStartItem created a duplicate of the item's class name before converting it into an FName. - Removed game check for Doom from P_BloodSplatter. The BloodSplatter actor diff --git a/src/d_player.h b/src/d_player.h index 68eeb4fd2..638dd0073 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -69,8 +69,6 @@ public: virtual void PlayIdle (); virtual void PlayRunning (); - virtual void PlayAttacking (); - virtual void PlayAttacking2 (); virtual void ThrowPoisonBag (); virtual void GiveDefaultInventory (); virtual void TweakSpeeds (int &forwardmove, int &sidemove); @@ -82,6 +80,8 @@ public: virtual void GiveDeathmatchInventory (); virtual void FilterCoopRespawnInventory (APlayerPawn *oldplayer); + void PlayAttacking (); + void PlayAttacking2 (); const char *GetSoundClass (); enum EInvulState diff --git a/src/g_doom/a_doomplayer.cpp b/src/g_doom/a_doomplayer.cpp index e70422c9b..03550d287 100644 --- a/src/g_doom/a_doomplayer.cpp +++ b/src/g_doom/a_doomplayer.cpp @@ -92,6 +92,7 @@ IMPLEMENT_ACTOR (ADoomPlayer, Doom, -1, 0) PROP_SeeState (S_PLAY_RUN) PROP_PainState (S_PLAY_PAIN) PROP_MissileState (S_PLAY_ATK) + PROP_MeleeState (S_PLAY_ATK+1) PROP_DeathState (S_PLAY_DIE) PROP_XDeathState (S_PLAY_XDIE) diff --git a/src/g_heretic/a_chicken.cpp b/src/g_heretic/a_chicken.cpp index 096dde002..6339eba2e 100644 --- a/src/g_heretic/a_chicken.cpp +++ b/src/g_heretic/a_chicken.cpp @@ -156,6 +156,7 @@ IMPLEMENT_ACTOR (AChickenPlayer, Heretic, -1, 0) PROP_SeeState (S_CHICPLAY_RUN) PROP_PainState (S_CHICPLAY_PAIN) PROP_MissileState (S_CHICPLAY_ATK) + PROP_MeleeState (S_CHICPLAY_ATK) PROP_DeathState (S_CHICPLAY_DIE) // [GRB] diff --git a/src/g_heretic/a_hereticplayer.cpp b/src/g_heretic/a_hereticplayer.cpp index 76e80b9d7..6acae5890 100644 --- a/src/g_heretic/a_hereticplayer.cpp +++ b/src/g_heretic/a_hereticplayer.cpp @@ -125,7 +125,8 @@ IMPLEMENT_ACTOR (AHereticPlayer, Heretic, -1, 0) PROP_SpawnState (S_PLAY) PROP_SeeState (S_PLAY_RUN) PROP_PainState (S_PLAY_PAIN) - PROP_MissileState (S_PLAY_ATK) + PROP_MissileState (S_PLAY_ATK+1) // Heretic never uses the non-flash attack state directly. + PROP_MeleeState (S_PLAY_ATK+1) PROP_DeathState (S_PLAY_DIE) PROP_XDeathState (S_PLAY_XDIE) PROP_BDeathState (S_PLAY_FDTH) diff --git a/src/g_hexen/a_clericplayer.cpp b/src/g_hexen/a_clericplayer.cpp index 0b97be5b0..e7113b991 100644 --- a/src/g_hexen/a_clericplayer.cpp +++ b/src/g_hexen/a_clericplayer.cpp @@ -101,6 +101,7 @@ IMPLEMENT_ACTOR (AClericPlayer, Hexen, -1, 0) PROP_SeeState (S_CPLAY_RUN1) PROP_PainState (S_CPLAY_PAIN) PROP_MissileState (S_CPLAY_ATK1) + PROP_MeleeState (S_CPLAY_ATK1) PROP_DeathState (S_CPLAY_DIE1) PROP_XDeathState (S_CPLAY_XDIE1) PROP_BDeathState (S_PLAY_C_FDTH) @@ -118,11 +119,6 @@ IMPLEMENT_ACTOR (AClericPlayer, Hexen, -1, 0) PROP_PainSound ("PlayerClericPain") END_DEFAULTS -void AClericPlayer::PlayAttacking2 () -{ - SetState (MissileState); -} - void AClericPlayer::GiveDefaultInventory () { Super::GiveDefaultInventory (); diff --git a/src/g_hexen/a_fighterplayer.cpp b/src/g_hexen/a_fighterplayer.cpp index 48dcf076a..d10e0d33f 100644 --- a/src/g_hexen/a_fighterplayer.cpp +++ b/src/g_hexen/a_fighterplayer.cpp @@ -99,6 +99,7 @@ IMPLEMENT_ACTOR (AFighterPlayer, Hexen, -1, 0) PROP_SeeState (S_FPLAY_RUN) PROP_PainState (S_FPLAY_PAIN) PROP_MissileState (S_FPLAY_ATK) + PROP_MeleeState (S_FPLAY_ATK) PROP_DeathState (S_FPLAY_DIE) PROP_XDeathState (S_FPLAY_XDIE) PROP_BDeathState (S_PLAY_F_FDTH) @@ -120,11 +121,6 @@ IMPLEMENT_ACTOR (AFighterPlayer, Hexen, -1, 0) PROP_PainSound ("PlayerFighterPain") END_DEFAULTS -void AFighterPlayer::PlayAttacking2 () -{ - SetState (MissileState); -} - void AFighterPlayer::GiveDefaultInventory () { Super::GiveDefaultInventory (); diff --git a/src/g_hexen/a_hexenglobal.h b/src/g_hexen/a_hexenglobal.h index 0a16082f7..a14f5f6f5 100644 --- a/src/g_hexen/a_hexenglobal.h +++ b/src/g_hexen/a_hexenglobal.h @@ -81,7 +81,6 @@ class AFighterPlayer : public APlayerPawn { DECLARE_ACTOR (AFighterPlayer, APlayerPawn) public: - void PlayAttacking2 (); void GiveDefaultInventory (); bool DoHealingRadius (APlayerPawn *other); }; @@ -97,7 +96,6 @@ class AClericPlayer : public APlayerPawn { DECLARE_ACTOR (AClericPlayer, APlayerPawn) public: - void PlayAttacking2 (); void GiveDefaultInventory (); void SpecialInvulnerabilityHandling (EInvulState state, fixed_t * pAlpha); }; @@ -113,7 +111,6 @@ class AMagePlayer : public APlayerPawn { DECLARE_ACTOR (AMagePlayer, APlayerPawn) public: - void PlayAttacking2 (); void GiveDefaultInventory (); bool DoHealingRadius (APlayerPawn *other); void SpecialInvulnerabilityHandling (EInvulState state, fixed_t * pAlpha); diff --git a/src/g_hexen/a_mageplayer.cpp b/src/g_hexen/a_mageplayer.cpp index bd4d9a40e..2e3fdac39 100644 --- a/src/g_hexen/a_mageplayer.cpp +++ b/src/g_hexen/a_mageplayer.cpp @@ -98,6 +98,7 @@ IMPLEMENT_ACTOR (AMagePlayer, Hexen, -1, 0) PROP_SeeState (S_MPLAY_RUN1) PROP_PainState (S_MPLAY_PAIN) PROP_MissileState (S_MPLAY_ATK1) + PROP_MeleeState (S_MPLAY_ATK1) PROP_DeathState (S_MPLAY_DIE1) PROP_XDeathState (S_MPLAY_XDIE1) PROP_BDeathState (S_PLAY_M_FDTH) @@ -119,11 +120,6 @@ IMPLEMENT_ACTOR (AMagePlayer, Hexen, -1, 0) PROP_PainSound ("PlayerMagePain") END_DEFAULTS -void AMagePlayer::PlayAttacking2 () -{ - SetState (MissileState); -} - void AMagePlayer::GiveDefaultInventory () { Super::GiveDefaultInventory (); diff --git a/src/g_hexen/a_pig.cpp b/src/g_hexen/a_pig.cpp index f4031e83f..826ea151f 100644 --- a/src/g_hexen/a_pig.cpp +++ b/src/g_hexen/a_pig.cpp @@ -143,6 +143,7 @@ IMPLEMENT_ACTOR (APigPlayer, Hexen, -1, 0) PROP_SeeState (S_PIGPLAY_RUN1) PROP_PainState (S_PIGPLAY_PAIN) PROP_MissileState (S_PIGPLAY_ATK1) + PROP_MeleeState (S_PIGPLAY_ATK1) PROP_DeathState (S_PIGPLAY_DIE1) PROP_IDeathState (S_PIGPLAY_ICE) diff --git a/src/g_strife/a_strifeplayer.cpp b/src/g_strife/a_strifeplayer.cpp index 1ef0a2b5f..83a472754 100644 --- a/src/g_strife/a_strifeplayer.cpp +++ b/src/g_strife/a_strifeplayer.cpp @@ -126,6 +126,7 @@ IMPLEMENT_ACTOR (AStrifePlayer, Strife, -1, 0) PROP_SeeState (S_PLAY_RUN) PROP_PainState (S_PLAY_PAIN) PROP_MissileState (S_PLAY_ATK) + PROP_MeleeState (S_PLAY_ATK+1) PROP_DeathState (S_PLAY_DIE) PROP_XDeathState (S_PLAY_XDIE) PROP_BDeathState (S_PLAY_BURNDEATH) diff --git a/src/m_menu.cpp b/src/m_menu.cpp index d8ee001e7..9ba8c5311 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -1843,9 +1843,9 @@ static void M_ChooseClass (int choice) { M_SetupNextMenu (&EpiDef); } - else if (!EpisodeNoSkill[0]) + else if (EpisodeNoSkill[0]) { - M_SetupNextMenu (&HexenSkillMenu); + M_ChooseSkill(2); } else if (gameinfo.gametype & (GAME_Doom|GAME_Strife)) { diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index cba4c79d3..db1b09b0f 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -269,14 +269,7 @@ void P_FireWeapon (player_t *player) return; } - if (gameinfo.gametype == GAME_Heretic) - { - player->mo->PlayAttacking2 (); - } - else - { - player->mo->PlayAttacking (); - } + player->mo->PlayAttacking (); weapon->bAltFire = false; P_SetPsprite (player, ps_weapon, player->refire ? weapon->GetHoldAtkState() : weapon->GetAtkState()); @@ -309,14 +302,7 @@ void P_FireWeaponAlt (player_t *player) return; } - if (gameinfo.gametype == GAME_Heretic) - { - player->mo->PlayAttacking2 (); - } - else - { - player->mo->PlayAttacking (); - } + player->mo->PlayAttacking (); weapon->bAltFire = true; P_SetPsprite (player, ps_weapon, player->refire ? weapon->AltHoldAtkState : weapon->AltAtkState); diff --git a/src/p_user.cpp b/src/p_user.cpp index 8b3a870a8..a87d1168c 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -842,7 +842,7 @@ void APlayerPawn::PlayAttacking () void APlayerPawn::PlayAttacking2 () { - SetState (MissileState+1); + SetState (MeleeState); } void APlayerPawn::ThrowPoisonBag () diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 92caad76e..ade8a0229 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -1427,18 +1427,16 @@ int S_FindSkinnedSound (AActor *actor, const char *name) int S_FindSkinnedSound (AActor *actor, int refid) { const char *pclass; - int gender; + int gender = GENDER_MALE; - if (actor != NULL && actor->player != NULL) + if (actor != NULL && actor->IsKindOf(RUNTIME_CLASS(APlayerPawn))) { - pclass = actor->player->mo->GetSoundClass (); - gender = actor->player->userinfo.gender; + pclass = static_cast(actor)->GetSoundClass (); + if (actor->player != NULL) gender = actor->player->userinfo.gender; } else { - pclass = - ((APlayerPawn *)GetDefaultByType (PlayerClasses[0].Type))->GetSoundClass (); - gender = GENDER_MALE; + pclass = gameinfo.gametype == GAME_Hexen? "fighter" : "player"; } return S_LookupPlayerSound (pclass, gender, refid);