mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- Fixed: After loading a savegame or unmorphing, a player's weapon slots
were empty. SVN r1477 (trunk)
This commit is contained in:
parent
69c2c4de64
commit
7dd75670f4
6 changed files with 38 additions and 8 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
virtual void GiveDeathmatchInventory ();
|
||||
virtual void FilterCoopRespawnInventory (APlayerPawn *oldplayer);
|
||||
|
||||
void SetupWeaponSlots ();
|
||||
void GiveDefaultInventory ();
|
||||
void PlayAttacking ();
|
||||
void PlayAttacking2 ();
|
||||
|
|
|
@ -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,9 +1501,19 @@ 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())
|
||||
{
|
||||
P_Recalculate3DFloors(§ors[i]);
|
||||
for (i = 0; i < numsectors; i++)
|
||||
{
|
||||
P_Recalculate3DFloors(§ors[i]);
|
||||
}
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (playeringame[i] && players[i].mo != NULL)
|
||||
{
|
||||
players[i].mo->SetupWeaponSlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Checking zdoom.pk3..."
|
||||
CommandLine=""$(SolutionDir)tools\zipdir\zipdir.exe" -ud "$(InputDir)zdoom.pk3" "$(InputDir)static" "$(InputDir)generated""
|
||||
CommandLine=""$(SolutionDir)tools\zipdir\zipdir.exe" -ud "$(InputDir)zdoom.pk3" "$(InputDir)static" "$(InputDir)generated"
copy "$(InputDir)zdoom.pk3" "$(SolutionDir)..\zdoom.pk3""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -59,7 +59,7 @@
|
|||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Checking zdoom.pk3..."
|
||||
CommandLine=""$(SolutionDir)tools\zipdir\zipdir.exe" -ud "$(InputDir)zdoom.pk3" "$(InputDir)static" "$(InputDir)generated""
|
||||
CommandLine=""$(SolutionDir)tools\zipdir\zipdir.exe" -ud "$(InputDir)zdoom.pk3" "$(InputDir)static" "$(InputDir)generated"
copy "$(InputDir)zdoom.pk3" "$(SolutionDir)..\zdoom.pk3""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
|
Loading…
Reference in a new issue