- Fixed: D_dehacked.cpp/PatchThing() allocated an actor on the stack.

SVN r800 (trunk)
This commit is contained in:
Randy Heit 2008-03-13 00:45:35 +00:00
parent 1e8064306e
commit ff387a952c
2 changed files with 6 additions and 4 deletions

View file

@ -1,4 +1,5 @@
March 12, 2008 March 12, 2008
- Fixed: D_dehacked.cpp/PatchThing() allocated an actor on the stack.
- Changed the sentinels in the thinker lists into a proper thinker. The old - Changed the sentinels in the thinker lists into a proper thinker. The old
way wasn't playing well with the write barriers. way wasn't playing well with the write barriers.
- Fixed: DFrameBuffer::WriteSavePic needs to fix the canvas in place while - Fixed: DFrameBuffer::WriteSavePic needs to fix the canvas in place while

View file

@ -699,7 +699,8 @@ static int PatchThing (int thingy)
}; };
int result; int result;
AActor *info, dummy; AActor *info;
BYTE dummy[sizeof(AActor)];
bool hadHeight = false; bool hadHeight = false;
bool hadTranslucency = false; bool hadTranslucency = false;
bool hadStyle = false; bool hadStyle = false;
@ -709,7 +710,7 @@ static int PatchThing (int thingy)
SWORD *ednum, dummyed; SWORD *ednum, dummyed;
type = NULL; type = NULL;
info = &dummy; info = (AActor *)&dummy;
ednum = &dummyed; ednum = &dummyed;
if (thingy > NumInfos || thingy <= 0) if (thingy > NumInfos || thingy <= 0)
{ {
@ -723,7 +724,7 @@ static int PatchThing (int thingy)
type = PClass::FindClass (GetName (InfoNames[thingy - 1])); type = PClass::FindClass (GetName (InfoNames[thingy - 1]));
if (type == NULL) if (type == NULL)
{ {
info = &dummy; info = (AActor *)&dummy;
ednum = &dummyed; ednum = &dummyed;
Printf ("Could not find thing %s (index %d)\n", Printf ("Could not find thing %s (index %d)\n",
GetName (InfoNames[thingy - 1]), thingy); GetName (InfoNames[thingy - 1]), thingy);
@ -1024,7 +1025,7 @@ static int PatchThing (int thingy)
else Printf (unknown_str, Line1, "Thing", thingy); else Printf (unknown_str, Line1, "Thing", thingy);
} }
if (info != &dummy) if (info != (AActor *)&dummy)
{ {
// Reset heights for things hanging from the ceiling that // Reset heights for things hanging from the ceiling that
// don't specify a new height. // don't specify a new height.