From ba7850441986abc92660b20feadc52f07882b029 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 15 Jun 2006 08:26:13 +0000 Subject: [PATCH] Fixed index variable in P_OpenMapData. SVN r192 (trunk) --- src/doomdata.h | 1 + src/p_setup.cpp | 6 +++--- src/p_setup.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/doomdata.h b/src/doomdata.h index ccf07d5f5b..baed913976 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -55,6 +55,7 @@ enum ML_BLOCKMAP, // LUT, motion clipping, walls/grid element ML_BEHAVIOR, // [RH] Hexen-style scripts. If present, THINGS // and LINEDEFS are also Hexen-style. + ML_MAX, // [RH] These are compressed (and extended) nodes. They combine the data from // vertexes, segs, ssectors, and nodes into a single lump. diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 25855def88..2296d2687c 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -207,7 +207,7 @@ static int GetMapIndex(const char *mapname, int lastindex, const char *lumpname, {"REJECT", false}, {"BLOCKMAP", false}, {"BEHAVIOR", false}, - {"SCRIPTS", false}, + //{"SCRIPTS", false}, }; if (lumpname==NULL) lumpname=""; @@ -296,7 +296,7 @@ MapData *P_OpenMapData(const char * mapname) map->MapLumps[index].FilePos = Wads.GetLumpOffset(lump_name + i); map->MapLumps[index].Size = Wads.LumpLength(lump_name + i); - strncpy(map->MapLumps[i].Name, lumpname, 8); + strncpy(map->MapLumps[index].Name, lumpname, 8); } return map; } @@ -351,7 +351,7 @@ MapData *P_OpenMapData(const char * mapname) map->MapLumps[index].FilePos = offset; map->MapLumps[index].Size = size; - strncpy(map->MapLumps[i].Name, lumpname, 8); + strncpy(map->MapLumps[index].Name, lumpname, 8); } } else diff --git a/src/p_setup.h b/src/p_setup.h index f6c97c92c8..31042301cb 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -30,7 +30,7 @@ struct MapData { - wadlump_t MapLumps[ML_BEHAVIOR+1]; + wadlump_t MapLumps[ML_MAX]; bool HasBehavior; bool CloseOnDestruct; bool Encrypted;