From a0d7693f33e8761a103ce6d33153dcf6537eb989 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Sep 2010 14:09:48 +0000 Subject: [PATCH] - added Spleen's fix for not running 2 frames of the weapon when the player spawns. SVN r2783 (trunk) --- src/g_game.cpp | 5 ++++- src/p_pspr.cpp | 6 ++++++ src/p_user.cpp | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index caf43cd6f0..cd9cd6f4ad 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1345,7 +1345,10 @@ void G_PlayerReborn (int player) if (gamestate != GS_TITLELEVEL) { actor->GiveDefaultInventory (); - p->ReadyWeapon = p->PendingWeapon; + + // [Spleen] ReadyWeapon will be set when P_MovePsprites calls P_BringUpWeapon + p->ReadyWeapon = NULL; + //p->ReadyWeapon = p->PendingWeapon; } //Added by MC: Init bot structure. diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index a30e2d7360..0a9e3eb4e8 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -794,9 +794,15 @@ void P_SetupPsprites(player_t *player) { player->psprites[i].state = NULL; } + + + // [Spleen] Let P_MovePsprites handle calling P_BringUpWeapon, + // instead of P_SetupPsprites, to avoid raising it twice in one tic. + /* // Spawn the ready weapon player->PendingWeapon = player->ReadyWeapon; P_BringUpWeapon (player); + */ } //------------------------------------------------------------------------ diff --git a/src/p_user.cpp b/src/p_user.cpp index eef4f5025f..f94cf70885 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1103,7 +1103,10 @@ void APlayerPawn::GiveDefaultInventory () if (item != NULL && item->IsKindOf (RUNTIME_CLASS (AWeapon)) && static_cast(item)->CheckAmmo(AWeapon::EitherFire, false)) { - player->ReadyWeapon = player->PendingWeapon = static_cast (item); + // [Spleen] ReadyWeapon will be set when P_MovePsprites calls P_BringUpWeapon + player->PendingWeapon = static_cast (item); + player->ReadyWeapon = NULL; + //player->ReadyWeapon = player->PendingWeapon = static_cast (item); } } di = di->Next;