Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump multiplayer to 16 players #551

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions Source/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]);

Expand Down
14 changes: 5 additions & 9 deletions Source/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Source/msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++;
Expand Down
4 changes: 2 additions & 2 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down
4 changes: 2 additions & 2 deletions Source/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
12 changes: 6 additions & 6 deletions Source/portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions Source/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef __PORTAL_H__
#define __PORTAL_H__

extern PortalStruct portal[MAXPORTAL];
extern PortalStruct portal[MAX_PLRS];
extern int portalindex;

void InitPortals();
Expand All @@ -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__ */
2 changes: 1 addition & 1 deletion SourceX/DiabloUI/selconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down