From ee12c25f475b80fc262f271e17285728a610e497 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 10 May 2006 16:43:46 +0000 Subject: [PATCH] - Fixed: PClass::CreateNew didn't check whether the class had valid defaults and tried to copy data from a NULL pointer. - Fixed: FireThing and BrassTorch were misspelled in hexendecorations.txt SVN r104 (trunk) --- docs/rh-log.txt | 3 +++ src/dobjtype.cpp | 5 ++++- wadsrc/decorate/hexen/hexendecorations.txt | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 6abde8c5c..db3ce8c45 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ May 10, 2006 (Changes by Graf Zahl) +- Fixed: PClass::CreateNew didn't check whether the class had valid + defaults and tried to copy data from a NULL pointer. +- Fixed: FireThing and BrassTorch were misspelled in hexendecorations.txt - Changed A_ChangeFlag so that it doesn't need to alter the flag string. With strings being passed as names this is unsafe. - Removed unused parameter types from the function parameter parser for diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index b9292b8fd..60e29bc59 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -165,7 +165,10 @@ DObject *PClass::CreateNew () const BYTE *mem = (BYTE *)M_Malloc (Size); // Set this object's defaults before constructing it. - memcpy (mem, Defaults, Size); + if (Defaults!=NULL) + memcpy (mem, Defaults, Size); + else + memset (mem, 0, Size); ConstructNative (mem); ((DObject *)mem)->SetClass (const_cast(this)); diff --git a/wadsrc/decorate/hexen/hexendecorations.txt b/wadsrc/decorate/hexen/hexendecorations.txt index c4755078d..a1310fff3 100644 --- a/wadsrc/decorate/hexen/hexendecorations.txt +++ b/wadsrc/decorate/hexen/hexendecorations.txt @@ -1139,7 +1139,7 @@ ACTOR ZBucket 8103 } } -ACTOR ZFireThing 8060 +ACTOR FireThing 8060 { Game Hexen Radius 5 @@ -1161,7 +1161,7 @@ ACTOR ZFireThing 8060 } } -ACTOR ZBrassTorch 8061 +ACTOR BrassTorch 8061 { Game Hexen Radius 6