- Fixed: After loading a savegame or unmorphing, a player's weapon slots

were empty.


SVN r1477 (trunk)
This commit is contained in:
Randy Heit 2009-03-13 03:18:06 +00:00
parent 69c2c4de64
commit 7dd75670f4
6 changed files with 38 additions and 8 deletions

View file

@ -1,4 +1,8 @@
March 11, 2009
March 12, 2009
- Fixed: After loading a savegame or unmorphing, a player's weapon slots
were empty.
March 11, 2009
- Moved weapon slot initialization into APlayerPawn::PostBeginPlay() so that
they can be initialized when players respawn in multiplayer.

View file

@ -98,6 +98,7 @@ public:
virtual void GiveDeathmatchInventory ();
virtual void FilterCoopRespawnInventory (APlayerPawn *oldplayer);
void SetupWeaponSlots ();
void GiveDefaultInventory ();
void PlayAttacking ();
void PlayAttacking2 ();

View file

@ -1412,7 +1412,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
// Hub transitions must keep the current total time
if (!hubLoad)
level.totaltime=i;
level.totaltime = i;
if (arc.IsStoring ())
{
@ -1501,10 +1501,20 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
P_SerializePlayers (arc, hubLoad);
P_SerializeSounds (arc);
if (arc.IsLoading()) for(i=0;i<numsectors;i++)
if (arc.IsLoading())
{
for (i = 0; i < numsectors; i++)
{
P_Recalculate3DFloors(&sectors[i]);
}
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i] && players[i].mo != NULL)
{
players[i].mo->SetupWeaponSlots();
}
}
}
}
//==========================================================================

View file

@ -97,7 +97,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i
// [MH] Used by SBARINFO to speed up face drawing
p->MorphedPlayerClass = 0;
for (unsigned int i = 1; i < PlayerClasses.Size (); i++)
for (unsigned int i = 1; i < PlayerClasses.Size(); i++)
{
if (PlayerClasses[i].Type == spawntype)
{
@ -309,6 +309,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, bool force)
angle = mo->angle >> ANGLETOFINESHIFT;
Spawn(exit_flash, pmo->x + 20*finecosine[angle], pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT, ALLOW_REPLACE);
mo->SetupWeaponSlots(); // Use original class's weapon slots.
beastweap = player->ReadyWeapon;
if (player->PremorphWeapon != NULL)
{

View file

@ -499,7 +499,21 @@ void APlayerPawn::Tick()
void APlayerPawn::PostBeginPlay()
{
// If we're not a voodoo doll, set up our weapons.
SetupWeaponSlots();
}
//===========================================================================
//
// APlayerPawn :: SetupWeaponSlots
//
// Sets up the default weapon slots for this player. If this is also the
// local player, determines local modifications and sends those across the
// network. Ignores voodoo dolls.
//
//===========================================================================
void APlayerPawn::SetupWeaponSlots()
{
if (player != NULL && player->mo == this)
{
player->weapons.StandardSetup(GetClass());

View file

@ -37,7 +37,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking zdoom.pk3..."
CommandLine="&quot;$(SolutionDir)tools\zipdir\zipdir.exe&quot; -ud &quot;$(InputDir)zdoom.pk3&quot; &quot;$(InputDir)static&quot; &quot;$(InputDir)generated&quot;"
CommandLine="&quot;$(SolutionDir)tools\zipdir\zipdir.exe&quot; -ud &quot;$(InputDir)zdoom.pk3&quot; &quot;$(InputDir)static&quot; &quot;$(InputDir)generated&quot;&#x0D;&#x0A;copy &quot;$(InputDir)zdoom.pk3&quot; &quot;$(SolutionDir)..\zdoom.pk3&quot;"
/>
</Configuration>
<Configuration
@ -59,7 +59,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking zdoom.pk3..."
CommandLine="&quot;$(SolutionDir)tools\zipdir\zipdir.exe&quot; -ud &quot;$(InputDir)zdoom.pk3&quot; &quot;$(InputDir)static&quot; &quot;$(InputDir)generated&quot;"
CommandLine="&quot;$(SolutionDir)tools\zipdir\zipdir.exe&quot; -ud &quot;$(InputDir)zdoom.pk3&quot; &quot;$(InputDir)static&quot; &quot;$(InputDir)generated&quot;&#x0D;&#x0A;copy &quot;$(InputDir)zdoom.pk3&quot; &quot;$(SolutionDir)..\zdoom.pk3&quot;"
/>
</Configuration>
<Configuration