diff --git a/Source/control.cpp b/Source/control.cpp index 10b2f822257..0c31ed455cd 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -26,7 +26,7 @@ BYTE *pTalkBtns; int pstrjust[4]; int pnumlines; BOOL pinfoflag; -BOOL talkbtndown[3]; +BOOL talkbtndown[MAX_PLRS - 1]; int pSpell; BYTE *pManaBuff; char infoclr; diff --git a/Source/control.h b/Source/control.h index ef91a8b33d8..88081a66517 100644 --- a/Source/control.h +++ b/Source/control.h @@ -22,7 +22,7 @@ extern BYTE *pTalkBtns; extern int pstrjust[4]; extern int pnumlines; extern BOOL pinfoflag; -extern BOOL talkbtndown[3]; +extern BOOL talkbtndown[MAX_PLRS - 1]; extern int pSpell; extern BYTE *pManaBuff; extern char infoclr; diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index c76dcce563d..063f44b12bc 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -43,8 +43,8 @@ void LoadGame(BOOL firstflag) for (i = 0; i < MAXQUESTS; i++) LoadQuest(i); - for (i = 0; i < MAXPORTAL; i++) - LoadPortal(i); + LoadPortal(0); + tbuff += 6 * 4 * 3; // Unused portals LoadGameLevel(firstflag, 4); SyncInitPlr(myplr); @@ -828,8 +828,8 @@ void SaveGame() for (i = 0; i < MAXQUESTS; i++) SaveQuest(i); - for (i = 0; i < MAXPORTAL; i++) - SavePortal(i); + SavePortal(0); + tbuff += 6 * 4 * 3; // Unused portals for (i = 0; i < MAXMONSTERS; i++) ISave(monstkills[i]); diff --git a/Source/monster.cpp b/Source/monster.cpp index 1909b570037..e6c99bbef38 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -929,10 +929,8 @@ void InitMonsters() if (gbMaxPlayers != 1) CheckDungeonClear(); if (!setlevel) { - AddMonster(1, 0, 0, 0, FALSE); - AddMonster(1, 0, 0, 0, FALSE); - AddMonster(1, 0, 0, 0, FALSE); - AddMonster(1, 0, 0, 0, FALSE); + for (int j = 0; j < MAX_PLRS; j++) + AddMonster(1, 0, 0, 0, FALSE); } #ifndef SPAWN if (!setlevel && currlevel == 16) @@ -1029,10 +1027,8 @@ void SetMapMonsters(BYTE *pMap, int startx, int starty) int mtype; AddMonsterType(MT_GOLEM, 2); - AddMonster(1, 0, 0, 0, FALSE); - AddMonster(1, 0, 0, 0, FALSE); - AddMonster(1, 0, 0, 0, FALSE); - AddMonster(1, 0, 0, 0, FALSE); + for (int k = 0; k < MAX_PLRS; k++) + AddMonster(1, 0, 0, 0, FALSE); if (setlevel && setlvlnum == SL_VILEBETRAYER) { AddMonsterType(UniqMonst[UMT_LAZURUS].mtype, 4); AddMonsterType(UniqMonst[UMT_RED_VEX].mtype, 4); @@ -1652,7 +1648,7 @@ void MonstStartKill(int i, int pnum, BOOL sendmsg) SetRndSeed(monster[i]._mRndSeed); if (QuestStatus(QTYPE_GARB) && monster[i].mName == UniqMonst[UMT_GARBUD].mName) { CreateTypeItem(monster[i]._mx + 1, monster[i]._my + 1, TRUE, 4, 0, TRUE, FALSE); - } else if (i > 3) { + } else if (i > MAX_PLRS - 1) { SpawnItem(i, monster[i]._mx, monster[i]._my, sendmsg); } if (monster[i].MType->mtype == MT_DIABLO) diff --git a/Source/msg.cpp b/Source/msg.cpp index 8b41e7e3f56..4a6a6d9bddc 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -258,7 +258,7 @@ BYTE *DeltaExportJunk(BYTE *dst) MultiQuests *mq; DPortal *pD; - for (i = 0; i < MAXPORTAL; i++) { + for (i = 0; i < MAX_PLRS; i++) { pD = &sgJunk.portal[i]; if (pD->x == 0xFF) { *dst = 0xFF; @@ -1255,7 +1255,7 @@ void DeltaImportJunk(BYTE *src) int i; MultiQuests *mq; - for (i = 0; i < MAXPORTAL; i++) { + for (i = 0; i < MAX_PLRS; i++) { if (*src == 0xFF) { memset(&sgJunk.portal[i], 0xFF, sizeof(DPortal)); src++; diff --git a/Source/player.cpp b/Source/player.cpp index 855abb547ba..4f468303dae 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -29,8 +29,8 @@ const char CharChar[] = { /* data */ -int plrxoff[9] = { 0, 2, 0, 2, 1, 0, 1, 2, 1 }; -int plryoff[9] = { 0, 2, 2, 0, 1, 1, 0, 1, 2 }; +int plrxoff[16] = { 0, 2, 0, 2, 1, 0, 1, 2, 1, 3, 0, 3, 1, 3, 3, 2 }; +int plryoff[16] = { 0, 2, 2, 0, 1, 1, 0, 1, 2, 3, 3, 0, 3, 1, 2, 3 }; int plrxoff2[9] = { 0, 1, 0, 1, 2, 0, 1, 2, 2 }; int plryoff2[9] = { 0, 0, 1, 1, 0, 2, 2, 1, 2 }; char PlrGFXAnimLens[][11] = { diff --git a/Source/player.h b/Source/player.h index bc6943b7f62..ca738584cb9 100644 --- a/Source/player.h +++ b/Source/player.h @@ -117,8 +117,8 @@ extern const char CharChar[]; /* data */ -extern int plrxoff[9]; -extern int plryoff[9]; +extern int plrxoff[16]; +extern int plryoff[16]; extern int plrxoff2[9]; extern int plryoff2[9]; extern char PlrGFXAnimLens[][11]; diff --git a/Source/portal.cpp b/Source/portal.cpp index b614c66ef1f..8b48407189c 100644 --- a/Source/portal.cpp +++ b/Source/portal.cpp @@ -2,17 +2,17 @@ DEVILUTION_BEGIN_NAMESPACE -PortalStruct portal[MAXPORTAL]; +PortalStruct portal[MAX_PLRS]; int portalindex; -int WarpDropX[MAXPORTAL] = { 57, 59, 61, 63 }; -int WarpDropY[MAXPORTAL] = { 40, 40, 40, 40 }; +int WarpDropX[MAX_PLRS] = { 57, 59, 61, 63, 57, 59, 61, 63, 57, 59, 61, 63, 57, 59, 61, 63 }; +int WarpDropY[MAX_PLRS] = { 40, 40, 40, 40, 42, 42, 42, 42, 38, 38, 38, 38, 44, 44, 44, 44 }; void InitPortals() { int i; - for (i = 0; i < MAXPORTAL; i++) { + for (i = 0; i < MAX_PLRS; i++) { if (delta_portal_inited(i)) portal[i].open = FALSE; } @@ -50,7 +50,7 @@ void SyncPortals() { int i; - for (i = 0; i < MAXPORTAL; i++) { + for (i = 0; i < MAX_PLRS; i++) { if (!portal[i].open) continue; if (currlevel == 0) @@ -167,7 +167,7 @@ BOOL PosOkPortal(int lvl, int x, int y) { int i; - for (i = 0; i < MAXPORTAL; i++) { + for (i = 0; i < MAX_PLRS; i++) { if (portal[i].open && portal[i].level == lvl && ((portal[i].x == x && portal[i].y == y) || (portal[i].x == x - 1 && portal[i].y == y - 1))) return TRUE; } diff --git a/Source/portal.h b/Source/portal.h index 1690180dcf2..8196bbb7272 100644 --- a/Source/portal.h +++ b/Source/portal.h @@ -2,7 +2,7 @@ #ifndef __PORTAL_H__ #define __PORTAL_H__ -extern PortalStruct portal[MAXPORTAL]; +extern PortalStruct portal[MAX_PLRS]; extern int portalindex; void InitPortals(); @@ -20,7 +20,7 @@ void GetPortalLvlPos(); BOOL PosOkPortal(int lvl, int x, int y); /* rdata */ -extern int WarpDropX[MAXPORTAL]; -extern int WarpDropY[MAXPORTAL]; +extern int WarpDropX[MAX_PLRS]; +extern int WarpDropY[MAX_PLRS]; #endif /* __PORTAL_H__ */ diff --git a/SourceX/DiabloUI/selconn.cpp b/SourceX/DiabloUI/selconn.cpp index e67e2dfee50..1908930407e 100644 --- a/SourceX/DiabloUI/selconn.cpp +++ b/SourceX/DiabloUI/selconn.cpp @@ -6,7 +6,7 @@ namespace dvl { -char selconn_MaxPlayers[21]; +char selconn_MaxPlayers[32]; char selconn_Description[64]; char selconn_Gateway[129]; bool selconn_ReturnValue = false; diff --git a/defs.h b/defs.h index 11c48d1b224..eeaad1fc988 100644 --- a/defs.h +++ b/defs.h @@ -9,7 +9,7 @@ #define GMENU_ENABLED 0x80000000 // must be unsigned to generate unsigned comparisons with pnum -#define MAX_PLRS 4 +#define MAX_PLRS 16 #define MAX_CHARACTERS 10 #define MAX_LVLMTYPES 16 @@ -27,7 +27,6 @@ #define MAXMONSTERS 200 #define MAXMULTIQUESTS 4 #define MAXOBJECTS 127 -#define MAXPORTAL 4 #define MAXQUESTS 16 #define MAXTHEMES 50 #define MAXTILES 2048 diff --git a/structs.h b/structs.h index 7c0d1dd7ad9..bf9dac7f39d 100644 --- a/structs.h +++ b/structs.h @@ -939,7 +939,7 @@ typedef struct MultiQuests { } MultiQuests; typedef struct DJunk { - DPortal portal[MAXPORTAL]; + DPortal portal[MAX_PLRS]; MultiQuests quests[MAXMULTIQUESTS]; } DJunk; #pragma pack(pop)