Browse Source

Merge branch 'master' of https://github.com/diasurgical/devilution into ReleaseChrBtns

pull/88/head
qndel 7 years ago
parent
commit
999b1a5205
  1. 144
      Source/control.cpp
  2. 2
      Source/diablo.cpp
  3. 9
      Source/dx.cpp
  4. 20
      Source/gendung.cpp
  5. 157
      Source/inv.cpp
  6. 2
      Source/inv.h
  7. 144
      Source/quests.cpp
  8. 155
      Source/trigs.cpp
  9. 8
      types.h

144
Source/control.cpp

@ -358,35 +358,27 @@ void SetSpellTrans(char t)
void DrawSpell()
{
int v0; // ebp
char v1; // cl
char v2; // bl
int v3; // edi
int v4; // esi
char v6; // [esp+Fh] [ebp-5h]
v0 = myplr;
v1 = plr[myplr]._pRSpell;
v2 = plr[myplr]._pRSplType;
v3 = v1;
v6 = plr[myplr]._pRSpell;
v4 = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[v1];
if (v2 == RSPLTYPE_SPELL && v1 != -1) {
if (!CheckSpell(myplr, v1, RSPLTYPE_SPELL, TRUE))
v2 = RSPLTYPE_INVALID;
v0 = myplr;
if (v4 <= 0)
v2 = RSPLTYPE_INVALID;
}
if (!currlevel && v2 != RSPLTYPE_INVALID && !spelldata[v3].sTownSpell)
v2 = RSPLTYPE_INVALID;
if (plr[v0]._pRSpell < 0)
v2 = RSPLTYPE_INVALID;
SetSpellTrans(v2);
if (v6 == -1)
DrawSpellCel(629, 631, (BYTE *)pSpellCels, 27, 56);
char spl, st;
int tlvl;
spl = plr[myplr]._pRSpell;
st = plr[myplr]._pRSplType;
tlvl = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[spl];
if (st == RSPLTYPE_SPELL && spl != RSPLTYPE_INVALID) {
if (!CheckSpell(myplr, spl, RSPLTYPE_SPELL, TRUE))
st = RSPLTYPE_INVALID;
if (tlvl <= 0)
st = RSPLTYPE_INVALID;
}
if (!currlevel && st != RSPLTYPE_INVALID && !spelldata[spl].sTownSpell)
st = RSPLTYPE_INVALID;
if (plr[myplr]._pRSpell < 0)
st = RSPLTYPE_INVALID;
SetSpellTrans(st);
if (spl != RSPLTYPE_INVALID)
DrawSpellCel(629, 631, (BYTE *)pSpellCels, (char)SpellITbl[spl], 56);
else
DrawSpellCel(629, 631, (BYTE *)pSpellCels, (char)SpellITbl[v3], 56);
DrawSpellCel(629, 631, (BYTE *)pSpellCels, 27, 56);
}
void DrawSpellList()
@ -595,28 +587,17 @@ void SetSpell()
void SetSpeedSpell(int slot)
{
int v1; // esi
signed int v3; // ebp
int v5; // ebx
int *v6; // edi
int i;
v1 = pSpell;
if (pSpell != -1) {
v3 = 0;
v5 = pSplType;
v6 = plr[myplr]._pSplHotKey;
do {
if (*v6 == v1 && plr[myplr]._pSplTHotKey[v3] == v5)
*v6 = -1;
++v3;
++v6;
} while (v3 < 4);
plr[myplr]._pSplHotKey[slot] = v1;
plr[myplr]._pSplTHotKey[slot] = v5;
if (pSpell != SPL_INVALID) {
for (i = 0; i < 4; ++i) {
if (plr[myplr]._pSplHotKey[i] == pSpell && plr[myplr]._pSplTHotKey[i] == pSplType)
plr[myplr]._pSplHotKey[i] = SPL_INVALID;
}
plr[myplr]._pSplHotKey[slot] = pSpell;
plr[myplr]._pSplTHotKey[slot] = pSplType;
}
}
// 4B8834: using guessed type int pSpell;
// 4B8954: using guessed type int pSplType;
void ToggleSpell(int slot)
{
@ -1308,33 +1289,22 @@ void ClearCtrlPan()
void DrawCtrlPan()
{
signed int v0; // edi
int *v1; // esi
int v2; // ecx
int v3; // eax
int i;
v0 = 0;
v1 = (int *)PanBtnPos;
do {
v2 = *v1;
if (panbtn[v0])
CelDecodeOnly(v2 + 64, v1[1] + 178, (BYTE *)pPanelButtons, v0 + 1, 71);
for (i = 0; i < 6; i++) {
if (!panbtn[i])
DrawPanelBox(PanBtnPos[i][0], PanBtnPos[i][1] - 336, 71, 20, PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 160);
else
DrawPanelBox(v2, v1[1] - 336, 71, 20, v2 + 64, v1[1] + 160);
++v0;
v1 += 5;
} while (v0 < 6);
CelDecodeOnly(PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 178, (BYTE *)pPanelButtons, i + 1, 71);
}
if (numpanbtns == 8) {
CelDecodeOnly(151, 634, (BYTE *)pMultiBtns, panbtn[6] + 1, 33);
if (FriendlyMode)
v3 = panbtn[7] + 3;
CelDecodeOnly(591, 634, (BYTE *)pMultiBtns, panbtn[7] + 3, 33);
else
v3 = panbtn[7] + 5;
CelDecodeOnly(591, 634, (BYTE *)pMultiBtns, v3, 33);
CelDecodeOnly(591, 634, (BYTE *)pMultiBtns, panbtn[7] + 5, 33);
}
}
// 484368: using guessed type int FriendlyMode;
// 4B8A7C: using guessed type int numpanbtns;
void DoSpeedBook()
{
@ -1392,40 +1362,22 @@ void DoSpeedBook()
void DoPanBtn()
{
int v0; // edx
int v1; // ebx
int v2; // edi
int v3; // esi
int(*v4)[5]; // eax
int v5; // ecx
int i;
v0 = MouseX;
v1 = MouseY;
v2 = numpanbtns;
v3 = 0;
if (numpanbtns > 0) {
v4 = PanBtnPos;
do {
if (v0 >= (*v4)[0] && v0 <= (*v4)[0] + (*v4)[2]) {
v5 = (*v4)[1];
if (v1 >= v5 && v1 <= v5 + (*v4)[3]) {
panbtn[v3] = 1;
drawbtnflag = 1;
panbtndown = 1;
}
for (i = 0; i < numpanbtns; i++) {
if (MouseX >= PanBtnPos[i][0] && MouseX <= PanBtnPos[i][0] + PanBtnPos[i][2]) {
if (MouseY >= PanBtnPos[i][1] && MouseY <= PanBtnPos[i][1] + PanBtnPos[i][3]) {
panbtn[i] = 1;
drawbtnflag = 1;
panbtndown = 1;
}
++v3;
++v4;
} while (v3 < v2);
}
}
if (!spselflag && v0 >= 565 && v0 < 621 && v1 >= 416 && v1 < 472) {
if (!spselflag && MouseX >= 565 && MouseX < 621 && MouseY >= 416 && MouseY < 472) {
DoSpeedBook();
gamemenu_off();
}
}
// 4B8A7C: using guessed type int numpanbtns;
// 4B8C90: using guessed type int panbtndown;
// 4B8C98: using guessed type int spselflag;
void control_set_button_down(int btn_id)
{
@ -1459,10 +1411,10 @@ void control_check_btn_press()
void DoAutoMap()
{
if (currlevel || gbMaxPlayers != 1) {
if (automapflag)
automapflag = 0;
else
if (!automapflag)
StartAutomap();
else
automapflag = 0;
} else {
InitDiabloMsg(EMSG_NO_AUTOMAP_IN_TOWN);
}

2
Source/diablo.cpp

@ -171,7 +171,7 @@ void run_game_loop(unsigned int uMsg)
gbGameLoopStartup = 0;
DrawAndBlit();
}
#ifdef SLEEP
#ifdef SLEEPFIX
Sleep(1);
#endif
}

9
Source/dx.cpp

@ -67,6 +67,15 @@ void dx_init(HWND hWnd)
v3 = dx_DirectDrawCreate(v2, &lpDDInterface, NULL);
if (v3)
ErrDlg(IDD_DIALOG1, v3, "C:\\Src\\Diablo\\Source\\dx.cpp", 149);
#ifdef COLORFIX
#ifdef __DDRAWI_INCLUDED__
((LPDDRAWI_DIRECTDRAW_INT)lpDDInterface)->lpLcl->dwAppHackFlags |= 0x800;
#else
((DWORD **)lpDDInterface)[1][18] |= 0x800;
#endif
#endif
fullscreen = 1;
#ifdef __cplusplus
v4 = lpDDInterface->SetCooperativeLevel(v1, DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT | DDSCL_FULLSCREEN);

20
Source/gendung.cpp

@ -595,22 +595,14 @@ void DRLG_MRectTrans(int x1, int y1, int x2, int y2)
void DRLG_RectTrans(int x1, int y1, int x2, int y2)
{
int i; // esi
char *v5; // edx
int j; // eax
for (i = y1; i <= y2; ++i) {
if (x1 <= x2) {
v5 = &dTransVal[x1][i];
j = x2 - x1 + 1;
do {
*v5 = TransVal;
v5 += 112;
--j;
} while (j);
int i, j;
for (j = y1; j <= y2; j++) {
for (i = x1; i <= x2; i++) {
dTransVal[i][j] = TransVal;
}
}
++TransVal;
TransVal++;
}
// 5A5590: using guessed type char TransVal;

157
Source/inv.cpp

@ -619,112 +619,69 @@ LABEL_24:
return v6;
}
int GoldAutoPlace(int pnum)
BOOL GoldAutoPlace(int pnum)
{
int v1; // ebp
int v2; // edi
int v3; // ecx
int *v4; // esi
int v5; // eax
int v6; // edi
int *v7; // esi
int v8; // eax
signed int v9; // ebx
char *v10; // edx
int v11; // eax
int v12; // ecx
int pnuma; // [esp+10h] [ebp-4h]
pnuma = pnum;
v1 = pnum;
v2 = 0;
v3 = 0;
if (plr[v1]._pNumInv <= 0) {
LABEL_14:
v6 = 0;
if (plr[v1]._pNumInv <= 0) {
LABEL_28:
v9 = 39;
do {
if (v3)
break;
v10 = &plr[0].InvGrid[10 * (v9 / 10) + v1 * 21720 + v9 % 10];
if (!*v10) {
v11 = v1 * 21720 + 368 * plr[v1]._pNumInv;
qmemcpy((char *)plr[0].InvList + v11, &plr[v1].HoldItem, 0x170u);
++plr[v1]._pNumInv;
*v10 = plr[v1]._pNumInv;
v12 = plr[v1].HoldItem._ivalue;
if (v12 < 2500) {
if (v12 > 1000)
*(int *)((char *)&plr[0].InvList[0]._iCurs + v11) = 5;
else
*(int *)((char *)&plr[0].InvList[0]._iCurs + v11) = 4;
} else {
*(int *)((char *)&plr[0].InvList[0]._iCurs + v11) = 6;
}
plr[v1]._pGold = CalculateGold(pnuma);
v3 = 1;
}
--v9;
} while (v9 >= 0);
} else {
v7 = &plr[v1].InvList[0]._ivalue;
while (!v3) {
if (*(v7 - 47) == 11 && *v7 < 5000) {
v8 = plr[v1].HoldItem._ivalue + *v7;
if (v8 <= 5000) {
*v7 = v8;
if (v8 < 2500) {
if (v8 > 1000)
*(v7 - 1) = 5;
else
*(v7 - 1) = 4;
} else {
*(v7 - 1) = 6;
}
plr[v1]._pGold = CalculateGold(pnuma);
v3 = 1;
}
}
++v6;
v7 += 92;
if (v6 >= plr[v1]._pNumInv) {
if (v3)
return v3;
goto LABEL_28;
}
BOOL done;
int i, ii;
int xx, yy;
done = FALSE;
for (i = 0; i < plr[pnum]._pNumInv && !done; i++) {
if (plr[pnum].InvList[i]._itype == ITYPE_GOLD) {
if (plr[pnum].HoldItem._ivalue + plr[pnum].InvList[i]._ivalue <= 5000) {
plr[pnum].InvList[i]._ivalue = plr[pnum].HoldItem._ivalue + plr[pnum].InvList[i]._ivalue;
if (plr[pnum].InvList[i]._ivalue >= 2500)
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_LARGE;
else if (plr[pnum].InvList[i]._ivalue <= 1000)
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_SMALL;
else
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_MEDIUM;
plr[pnum]._pGold = CalculateGold(pnum);
done = TRUE;
}
}
} else {
v4 = &plr[v1].InvList[0]._ivalue;
while (!v3) {
if (*(v4 - 47) == 11) {
v5 = *v4 + plr[v1].HoldItem._ivalue;
if (v5 <= 5000) {
*v4 = v5;
if (v5 < 2500) {
if (v5 > 1000)
*(v4 - 1) = 5;
else
*(v4 - 1) = 4;
} else {
*(v4 - 1) = 6;
}
plr[v1]._pGold = CalculateGold(pnuma);
v3 = 1;
}
}
++v2;
v4 += 92;
if (v2 >= plr[v1]._pNumInv) {
if (v3)
return v3;
goto LABEL_14;
}
if (done)
return done;
for (i = 0; i < plr[pnum]._pNumInv && !done; i++) {
if (plr[pnum].InvList[i]._itype == ITYPE_GOLD && plr[pnum].InvList[i]._ivalue < 5000) {
if (plr[pnum].HoldItem._ivalue + plr[pnum].InvList[i]._ivalue <= 5000) {
plr[pnum].InvList[i]._ivalue = plr[pnum].HoldItem._ivalue + plr[pnum].InvList[i]._ivalue;
if (plr[pnum].InvList[i]._ivalue >= 2500)
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_LARGE;
else if (plr[pnum].InvList[i]._ivalue <= 1000)
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_SMALL;
else
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_MEDIUM;
plr[pnum]._pGold = CalculateGold(pnum);
done = TRUE;
}
}
}
return v3;
if (done)
return done;
for (i = 39; i >= 0 && !done; i--) {
yy = 10 * (i / 10);
xx = i % 10;
if (!plr[pnum].InvGrid[xx + yy]) {
ii = plr[pnum]._pNumInv;
plr[pnum].InvList[ii] = plr[pnum].HoldItem;
plr[pnum]._pNumInv = plr[pnum]._pNumInv + 1;
plr[pnum].InvGrid[xx + yy] = plr[pnum]._pNumInv;
if (plr[pnum].HoldItem._ivalue >= 2500)
plr[pnum].InvList[ii]._iCurs = ICURS_GOLD_LARGE;
else if (plr[pnum].HoldItem._ivalue <= 1000)
plr[pnum].InvList[ii]._iCurs = ICURS_GOLD_SMALL;
else
plr[pnum].InvList[ii]._iCurs = ICURS_GOLD_MEDIUM;
plr[pnum]._pGold = CalculateGold(pnum);
done = TRUE;
}
}
return done;
}
int WeaponAutoPlace(int pnum)

2
Source/inv.h

@ -12,7 +12,7 @@ void DrawInv();
void DrawInvBelt();
BOOL AutoPlace(int pnum, int ii, int sx, int sy, int saveflag);
int SpecialAutoPlace(int pnum, int ii, int sx, int sy, int saveflag);
int GoldAutoPlace(int pnum);
BOOL GoldAutoPlace(int pnum);
int WeaponAutoPlace(int pnum);
int SwapItem(ItemStruct *a, ItemStruct *b);
void CheckInvPaste(int pnum, int mx, int my);

144
Source/quests.cpp

@ -418,111 +418,71 @@ void DrawSkelKing(int q, int x, int y)
void DrawWarLord(int x, int y)
{
int v2; // esi
int v3; // edi
unsigned char *v4; // eax
int v5; // ebx
int v6; // edx
int v7; // edx
char *v8; // eax
int v9; // ecx
char *v10; // esi
char v11; // bl
unsigned char *ptr; // [esp+Ch] [ebp-Ch]
int v13; // [esp+10h] [ebp-8h]
int v14; // [esp+14h] [ebp-4h]
int rw, rh;
int i, j;
unsigned char *sp;
unsigned char *setp;
int v;
v2 = y;
v3 = x;
v4 = LoadFileInMem("Levels\\L4Data\\Warlord2.DUN", 0);
v5 = *v4;
ptr = v4;
v4 += 2;
v14 = v2;
v6 = *v4;
setpc_h = v6;
v7 = v2 + v6;
v8 = (char *)(v4 + 2);
setpc_w = v5;
setpc_x = v3;
setpc_y = v2;
if (v2 < v7) {
v13 = v3 + v5;
do {
if (v3 < v13) {
v9 = v13 - v3;
v10 = (char *)&dungeon[v3][v14];
do {
v11 = *v8;
if (!*v8)
v11 = 6;
*v10 = v11;
v8 += 2;
v10 += 40;
--v9;
} while (v9);
setp = LoadFileInMem("Levels\\L4Data\\Warlord2.DUN", NULL);
rw = *setp;
sp = setp + 2;
rh = *sp;
sp += 2;
setpc_w = rw;
setpc_h = rh;
setpc_x = x;
setpc_y = y;
for (j = y; j < y+rh; j++) {
for (i = x; i < x+rw; i++) {
if (*sp != 0) {
v = *sp;
} else {
v = 6;
}
++v14;
} while (v14 < v7);
dungeon[i][j] = v;
sp += 2;
}
}
mem_free_dbg(ptr);
mem_free_dbg(setp);
}
// 5CF330: using guessed type int setpc_h;
// 5CF334: using guessed type int setpc_w;
void DrawSChamber(int q, int x, int y)
{
int v3; // esi
unsigned char *v4; // eax
int v5; // edi
int v6; // ebx
int v7; // eax
char *v8; // ecx
int v9; // eax
char *v10; // edx
char v11; // bl
int v12; // edx
unsigned char *ptr; // [esp+Ch] [ebp-10h]
int v14; // [esp+10h] [ebp-Ch]
int v15; // [esp+14h] [ebp-8h]
int v16; // [esp+18h] [ebp-4h]
int i, j;
int rw, rh;
int xx, yy;
unsigned char *sp;
unsigned char *setp;
int v;
v3 = x;
v14 = q;
v4 = LoadFileInMem("Levels\\L2Data\\Bonestr1.DUN", 0);
v5 = y;
ptr = v4;
v6 = y;
v7 = *v4;
setpc_h = ptr[2];
v8 = (char *)(ptr + 4);
setpc_w = v7;
setpc_x = v3;
setp = LoadFileInMem("Levels\\L2Data\\Bonestr1.DUN", NULL);
rw = *setp;
sp = setp + 2;
rh = *sp;
sp += 2;
setpc_w = rw;
setpc_h = rh;
setpc_x = x;
setpc_y = y;
v15 = y + setpc_h;
if (y < y + setpc_h) {
v16 = v3 + v7;
do {
if (v3 < v16) {
v9 = v16 - v3;
v10 = (char *)&dungeon[v3][v6];
do {
v11 = *v8;
if (!*v8)
v11 = 3;
*v10 = v11;
v8 += 2;
v10 += 40;
--v9;
} while (v9);
for (j = y; j < y+rh; j++) {
for (i = x; i < x+rw; i++) {
if (*sp != 0) {
v = *sp;
} else {
v = 3;
}
v6 = y++ + 1;
} while (y < v15);
dungeon[i][j] = v;
sp += 2;
}
}
v12 = v14;
quests[v12]._qtx = 2 * v3 + 22;
quests[v12]._qty = 2 * v5 + 23;
mem_free_dbg(ptr);
xx = 2 * x + 22;
yy = 2 * y + 23;
quests[q]._qtx = xx;
quests[q]._qty = yy;
mem_free_dbg(setp);
}
// 5CF330: using guessed type int setpc_h;
// 5CF334: using guessed type int setpc_w;

155
Source/trigs.cpp

@ -823,108 +823,83 @@ void CheckTrigForce()
void CheckTriggers()
{
int *v0; // edi
int v1; // esi
int v2; // ecx
int v3; // eax
int v4; // edx
signed int v5; // edx
int v6; // eax
int v9; // [esp-4h] [ebp-20h]
int x; // [esp+Ch] [ebp-10h]
int y; // [esp+10h] [ebp-Ch]
int v12; // [esp+14h] [ebp-8h]
int error_id; // [esp+1Bh] [ebp-1h]
int x, y, i;
BOOL abort;
char abortflag;
if (plr[myplr]._pmode)
return;
v12 = 0;
if (trigflag[4] <= 0)
return;
v0 = &trigs[0]._tmsg;
while (1) {
v1 = myplr;
v2 = plr[myplr].WorldX;
if (v2 != *(v0 - 2))
goto LABEL_34;
v3 = plr[v1].WorldY;
if (v3 != *(v0 - 1))
goto LABEL_34;
v4 = *v0;
if (*v0 == WM_DIABNEXTLVL) {
for (i = 0; i < trigflag[4]; i++) {
if (plr[myplr].WorldX != trigs[i]._tx || plr[myplr].WorldY != trigs[i]._ty) {
continue;
}
switch (trigs[i]._tmsg) {
case WM_DIABNEXTLVL:
if (pcurs >= CURSOR_FIRSTITEM && DropItemBeforeTrig())
return;
v6 = currlevel + 1;
goto LABEL_32;
}
if (*v0 == WM_DIABPREVLVL) {
StartNewLvl(myplr, trigs[i]._tmsg, currlevel + 1);
break;
case WM_DIABPREVLVL:
if (pcurs >= CURSOR_FIRSTITEM && DropItemBeforeTrig())
return;
v6 = currlevel - 1;
LABEL_32:
v9 = v6;
goto LABEL_33;
}
if (*v0 != WM_DIABRTNLVL)
StartNewLvl(myplr, trigs[i]._tmsg, currlevel - 1);
break;
StartNewLvl(myplr, v4, ReturnLvl);
LABEL_34:
++v12;
v0 += 4;
if (v12 >= trigflag[4])
return;
}
if (*v0 != WM_DIABTOWNWARP) {
if (*v0 == WM_DIABTWARPUP) {
case WM_DIABRTNLVL:
StartNewLvl(myplr, trigs[i]._tmsg, ReturnLvl);
break;
case WM_DIABTOWNWARP:
if (gbMaxPlayers != 1) {
abort = FALSE;
if (trigs[i]._tlvl == 5 && plr[myplr]._pLevel < 8) {
abort = TRUE;
x = plr[myplr].WorldX;
y = plr[myplr].WorldY + 1;
abortflag = EMSG_REQUIRES_LVL_8;
}
if (trigs[i]._tlvl == 9 && plr[myplr]._pLevel < 13) {
abort = TRUE;
x = plr[myplr].WorldX + 1;
y = plr[myplr].WorldY;
abortflag = EMSG_REQUIRES_LVL_13;
}
if (trigs[i]._tlvl == 13 && plr[myplr]._pLevel < 17) {
abort = TRUE;
x = plr[myplr].WorldX;
y = plr[myplr].WorldY + 1;
abortflag = EMSG_REQUIRES_LVL_17;
}
if (abort) {
if (plr[myplr]._pClass == PC_WARRIOR) {
PlaySFX(PS_WARR43);
} else if (plr[myplr]._pClass == PC_ROGUE) {
PlaySFX(PS_ROGUE43);
} else if (plr[myplr]._pClass == PC_SORCERER) {
PlaySFX(PS_MAGE43);
}
InitDiabloMsg(abortflag);
NetSendCmdLoc(TRUE, CMD_WALKXY, x, y);
return;
}
}
StartNewLvl(myplr, trigs[i]._tmsg, trigs[i]._tlvl);
break;
case WM_DIABTWARPUP:
TWarpFrom = currlevel;
StartNewLvl(myplr, v4, 0);
} else {
StartNewLvl(myplr, trigs[i]._tmsg, 0);
break;
default:
app_fatal("Unknown trigger msg");
break;
}
goto LABEL_34;
}
if (gbMaxPlayers == 1)
goto LABEL_46;
v5 = 0;
if (v0[1] == 5 && plr[v1]._pLevel < 8) {
v5 = 1;
x = plr[myplr].WorldX;
_LOBYTE(y) = v3 + 1;
_LOBYTE(error_id) = EMSG_REQUIRES_LVL_8;
}
if (v0[1] == 9 && plr[v1]._pLevel < 13) {
v5 = 1;
_LOBYTE(x) = v2 + 1;
y = plr[v1].WorldY;
_LOBYTE(error_id) = EMSG_REQUIRES_LVL_13;
}
if (v0[1] == 13 && plr[v1]._pLevel < 17) {
x = plr[myplr].WorldX;
v5 = 1;
_LOBYTE(y) = v3 + 1;
_LOBYTE(error_id) = EMSG_REQUIRES_LVL_17;
}
if (!v5) {
LABEL_46:
v9 = v0[1];
LABEL_33:
StartNewLvl(myplr, *v0, v9);
goto LABEL_34;
}
switch (plr[myplr]._pClass) {
case PC_WARRIOR:
PlaySFX(PS_WARR43);
break;
case PC_ROGUE:
PlaySFX(PS_ROGUE43);
break;
case PC_SORCERER:
PlaySFX(PS_MAGE43);
break;
}
_LOBYTE(v2) = error_id;
InitDiabloMsg(v2);
NetSendCmdLoc(TRUE, CMD_WALKXY, x, y);
}
// 679660: using guessed type char gbMaxPlayers;
// 6ABB30: using guessed type int TWarpFrom;

8
types.h

@ -48,13 +48,19 @@
// If defined, use copy protection [Default -> Defined]
//#define COPYPROT
// If defined, don't reload for debuggers [Default -> Undefined]
// Note that with patch 1.03 the command line was hosed, this is required to pass arguments to the game
#ifdef _DEBUG
#define DEBUGGER
#endif
// If defined, don't fry the CPU [Default -> Undefined]
#define SLEEP
#define SLEEPFIX
// If defined, fix palette glitch in Windows Vista+ [Default -> Undefined]
//#define COLORFIX
// If defined, use standard memcpy() in place of qmemcpy() [Default -> Undefined]
// Will be replaced with [rep movsd] if optimization is used
#define FAST_MEMCPY

Loading…
Cancel
Save