Browse Source

Use the dungeon_type enum for leveltype

pull/136/head
Joan Karadimov 7 years ago
parent
commit
fce804a09a
  1. 2
      Source/gendung.cpp
  2. 22
      Source/loadsave.cpp
  3. 2
      Source/multi.cpp
  4. 4
      Source/objects.cpp
  5. 2
      Source/portal.cpp
  6. 4
      Source/themes.cpp

2
Source/gendung.cpp

@ -965,7 +965,7 @@ void InitLevels()
{
if (!leveldebug) {
currlevel = 0;
leveltype = 0;
leveltype = DTYPE_TOWN;
setlevel = 0;
}
}

22
Source/loadsave.cpp

@ -58,7 +58,7 @@ void LoadGame(BOOL firstflag)
for (i = 0; i < MAXMONSTERS; i++)
monstkills[i] = ILoad();
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (i = 0; i < MAXMONSTERS; i++)
monstactive[i] = WLoad();
for (i = 0; i < nummonsters; i++)
@ -118,7 +118,7 @@ void LoadGame(BOOL firstflag)
dItem[i][j] = BLoad();
}
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (j = 0; j < MAXDUNY; j++) {
for (i = 0; i < MAXDUNX; i++)
dMonster[i][j] = WLoad();
@ -161,7 +161,7 @@ void LoadGame(BOOL firstflag)
AutomapZoomReset();
ResyncQuests();
if (leveltype)
if (leveltype != DTYPE_TOWN)
ProcessLightList();
RedoPlayerVision();
@ -309,7 +309,7 @@ void SaveGame()
for (i = 0; i < MAXMONSTERS; i++)
ISave(monstkills[i]);
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (i = 0; i < MAXMONSTERS; i++)
WSave(monstactive[i]);
for (i = 0; i < nummonsters; i++)
@ -367,7 +367,7 @@ void SaveGame()
BSave(dItem[i][j]);
}
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (j = 0; j < MAXDUNY; j++) {
for (i = 0; i < MAXDUNX; i++)
WSave(dMonster[i][j]);
@ -523,7 +523,7 @@ void SaveLevel()
SaveBuff = DiabloAllocPtr(dwLen);
tbuff = SaveBuff;
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (j = 0; j < MAXDUNY; j++) {
for (i = 0; i < MAXDUNX; i++)
BSave(dDead[i][j]);
@ -534,7 +534,7 @@ void SaveLevel()
WSave(numitems);
WSave(nobjects);
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (i = 0; i < MAXMONSTERS; i++)
WSave(monstactive[i]);
for (i = 0; i < nummonsters; i++)
@ -563,7 +563,7 @@ void SaveLevel()
BSave(dItem[i][j]);
}
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (j = 0; j < MAXDUNY; j++) {
for (i = 0; i < MAXDUNX; i++)
WSave(dMonster[i][j]);
@ -612,7 +612,7 @@ void LoadLevel()
LoadBuff = pfile_read(szName, &dwLen);
tbuff = LoadBuff;
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (j = 0; j < MAXDUNY; j++) {
for (i = 0; i < MAXDUNX; i++)
dDead[i][j] = BLoad();
@ -624,7 +624,7 @@ void LoadLevel()
numitems = WLoad();
nobjects = WLoad();
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (i = 0; i < MAXMONSTERS; i++)
monstactive[i] = WLoad();
for (i = 0; i < nummonsters; i++)
@ -655,7 +655,7 @@ void LoadLevel()
dItem[i][j] = BLoad();
}
if (leveltype) {
if (leveltype != DTYPE_TOWN) {
for (j = 0; j < MAXDUNY; j++) {
for (i = 0; i < MAXDUNX; i++)
dMonster[i][j] = WLoad();

2
Source/multi.cpp

@ -778,7 +778,7 @@ void SetupLocalCoords()
if (!leveldebug || gbMaxPlayers > 1) {
currlevel = 0;
leveltype = 0;
leveltype = DTYPE_TOWN;
setlevel = 0;
}
x = 75;

4
Source/objects.cpp

@ -134,7 +134,7 @@ BOOL RndLocOk(int xp, int yp)
return FALSE;
if (nSolidTable[dPiece[xp][yp]])
return FALSE;
if (leveltype != 1 || dPiece[xp][yp] <= 126 || dPiece[xp][yp] >= 144)
if (leveltype != DTYPE_CATHEDRAL || dPiece[xp][yp] <= 126 || dPiece[xp][yp] >= 144)
return TRUE;
return FALSE;
}
@ -829,7 +829,7 @@ void InitObjects()
InitRndLocObj(5, 10, 5);
InitRndLocObj(3, 6, 6);
InitRndLocObj(1, 5, 7);
if (leveltype != 4)
if (leveltype != DTYPE_HELL)
AddObjTraps();
if (leveltype > 1u)
AddChestTraps();

2
Source/portal.cpp

@ -124,7 +124,7 @@ void GetPortalLevel()
setlevel = 0;
currlevel = 0;
plr[myplr].plrlevel = 0;
leveltype = 0;
leveltype = DTYPE_TOWN;
} else {
if (portal[portalindex].setlvl) {
setlevel = 1;

4
Source/themes.cpp

@ -144,7 +144,7 @@ BOOL TFit_SkelRoom(int t)
{
int i;
if (leveltype != 1 && leveltype != 2) {
if (leveltype != DTYPE_CATHEDRAL && leveltype != DTYPE_CATACOMBS) {
return FALSE;
}
@ -423,7 +423,7 @@ void InitThemes()
}
}
}
if (leveltype == 2 || leveltype == 3 || leveltype == 4) {
if (leveltype == DTYPE_CATACOMBS || leveltype == DTYPE_CAVES || leveltype == DTYPE_HELL) {
for (i = 0; i < themeCount; i++)
themes[i].ttype = THEME_NONE;
if (QuestStatus(QTYPE_ZHAR)) {

Loading…
Cancel
Save