- Fixed: The game would crash after informing you of a duplicate class registration

because PClass::CreateDerivedClass() did not initialize everything before calling
  InsertIntoHash().
- Fixed: Forcefully removing a weapon from a player's inventory would not reset
  the player's refire counter.
- Fixed: FreeKeySections() was called before M_SaveDefaults() during shutdown,
  so all custom keys would go to a "(null)" section instead of their intended
  section.


SVN r248 (trunk)
This commit is contained in:
Randy Heit 2006-07-13 02:08:39 +00:00
parent 18af8a57cf
commit 56427d1b1c
5 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,13 @@
July 12, 2006
- Fixed: The game would crash after informing you of a duplicate class registration
because PClass::CreateDerivedClass() did not initialize everything before calling
InsertIntoHash().
- Fixed: Forcefully removing a weapon from a player's inventory would not reset
the player's refire counter.
- Fixed: FreeKeySections() was called before M_SaveDefaults() during shutdown,
so all custom keys would go to a "(null)" section instead of their intended
section.
July 11, 2006 July 11, 2006
- Restored the previous level flag values to avoid needlessly breaking some - Restored the previous level flag values to avoid needlessly breaking some
savegames at this point in time. savegames at this point in time.

View File

@ -187,7 +187,6 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size)
type->Pointers = NULL; type->Pointers = NULL;
type->ConstructNative = ConstructNative; type->ConstructNative = ConstructNative;
type->ClassIndex = m_Types.Push (type); type->ClassIndex = m_Types.Push (type);
type->InsertIntoHash();
type->Meta = Meta; type->Meta = Meta;
type->Defaults = new BYTE[size]; type->Defaults = new BYTE[size];
memcpy (type->Defaults, Defaults, Size); memcpy (type->Defaults, Defaults, Size);
@ -197,6 +196,8 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size)
} }
type->FlatPointers = NULL; type->FlatPointers = NULL;
type->bRuntimeClass = true; type->bRuntimeClass = true;
type->ActorInfo = NULL;
type->InsertIntoHash();
// If this class has an actor info, then any classes derived from it // If this class has an actor info, then any classes derived from it
// also need an actor info. // also need an actor info.
@ -212,10 +213,6 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size)
info->Replacement = NULL; info->Replacement = NULL;
m_RuntimeActors.Push (type); m_RuntimeActors.Push (type);
} }
else
{
type->ActorInfo = NULL;
}
return type; return type;
} }

View File

@ -81,6 +81,8 @@ CVAR(Bool, screenshot_quiet, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CVAR(String, screenshot_type, "png", CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR(String, screenshot_type, "png", CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CVAR(String, screenshot_dir, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR(String, screenshot_dir, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
extern void FreeKeySections();
static long ParseCommandLine (const char *args, int *argc, char **argv); static long ParseCommandLine (const char *args, int *argc, char **argv);
// //
@ -358,6 +360,7 @@ void M_LoadDefaults ()
{ {
GameConfig = new FGameConfigFile; GameConfig = new FGameConfigFile;
GameConfig->DoGlobalSetup (); GameConfig->DoGlobalSetup ();
atterm (FreeKeySections);
atterm (M_SaveDefaults); atterm (M_SaveDefaults);
} }

View File

@ -2938,6 +2938,7 @@ void M_SaveCustomKeys (FConfigFile *config, char *section, char *subsection)
if (item->type == whitetext) if (item->type == whitetext)
{ {
assert (item->e.command != NULL);
sprintf (subsection, "%s.Bindings", item->e.command); sprintf (subsection, "%s.Bindings", item->e.command);
M_DoSaveKeys (config, section, (int)i, false); M_DoSaveKeys (config, section, (int)i, false);
sprintf (subsection, "%s.DoubleBindings", item->e.command); sprintf (subsection, "%s.DoubleBindings", item->e.command);
@ -2952,7 +2953,7 @@ void M_SaveCustomKeys (FConfigFile *config, char *section, char *subsection)
static int AddKeySpot; static int AddKeySpot;
static void FreeKeySections() void FreeKeySections()
{ {
const unsigned int numStdControls = countof(ControlsItems); const unsigned int numStdControls = countof(ControlsItems);
unsigned int i; unsigned int i;
@ -3008,7 +3009,6 @@ CCMD (addkeysection)
} }
} }
atterm (FreeKeySections);
if (i == last) if (i == last)
{ // Add the new section { // Add the new section
// Limit the ini name to 32 chars // Limit the ini name to 32 chars

View File

@ -330,9 +330,10 @@ void APlayerPawn::RemoveInventory (AInventory *item)
} }
if (item == player->ReadyWeapon) if (item == player->ReadyWeapon)
{ {
// If the current weapon is removed, pick a new one. // If the current weapon is removed, clear the refire counter and pick a new one.
pickWeap = true; pickWeap = true;
player->ReadyWeapon = NULL; player->ReadyWeapon = NULL;
player->refire = 0;
} }
} }
Super::RemoveInventory (item); Super::RemoveInventory (item);