Browse Source

Fix OOB in dungeon lvl2 Dark Passage generation (#400)

Dark Passage entrance index is 206 but the BSTYPES and L5BTYPES array
only contained 206 elements.
pull/399/head^2
Gleb Mazovetskiy 7 years ago committed by Anders Jenbo
parent
commit
9a58d42108
  1. 8
      Source/drlg_l1.cpp
  2. 4
      Source/drlg_l1.h

8
Source/drlg_l1.cpp

@ -57,7 +57,7 @@ const ShadowStruct SPATS[37] = {
};
// BUGFIX: This array should contain an additional 0 (207 elements).
const BYTE BSTYPES[206] = {
const BYTE BSTYPES[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 0, 0,
0, 0, 0, 0, 0, 1, 2, 10, 4, 5,
@ -78,11 +78,11 @@ const BYTE BSTYPES[206] = {
2, 13, 13, 13, 13, 25, 26, 28, 30, 31,
41, 43, 40, 41, 42, 43, 25, 41, 43, 28,
28, 1, 2, 25, 26, 22, 22, 25, 26, 0,
0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0
};
// BUGFIX: This array should contain an additional 0 (207 elements).
const BYTE L5BTYPES[206] = {
const BYTE L5BTYPES[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 0, 0,
0, 0, 0, 0, 0, 25, 26, 0, 28, 0,
@ -103,7 +103,7 @@ const BYTE L5BTYPES[206] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0
};
const BYTE STAIRSUP[] = { 4, 4, 13, 13, 13, 13, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 0, 66, 6, 0, 63, 64, 65, 0, 0, 67, 68, 0, 0, 0, 0, 0 };
const BYTE L5STAIRSUP[] = { 4, 4, 22, 22, 22, 22, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 0, 66, 23, 0, 63, 64, 65, 0, 0, 67, 68, 0, 0, 0, 0, 0 };

4
Source/drlg_l1.h

@ -22,8 +22,8 @@ void CreateL5Dungeon(DWORD rseed, int entry);
extern const ShadowStruct SPATS[37];
// BUGFIX: These arrays should contain an additional 0 (207 elements).
extern const BYTE BSTYPES[206];
extern const BYTE L5BTYPES[206];
extern const BYTE BSTYPES[207];
extern const BYTE L5BTYPES[207];
extern const BYTE STAIRSUP[];
extern const BYTE L5STAIRSUP[];

Loading…
Cancel
Save