From 57f1fcce4c6727b6437b2ad0691bdf2bb95e86d8 Mon Sep 17 00:00:00 2001 From: qndel Date: Sun, 20 Oct 2019 20:40:35 +0200 Subject: [PATCH] some enums (#1816) --- Source/diablo.cpp | 16 ++++++++-------- Source/inv.cpp | 18 +++++++++--------- Source/multi.cpp | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 7e53f72cb..25e5a6b28 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1335,43 +1335,43 @@ void PressChar(int vkey) case '!': case '1': if (plr[myplr].SpdList[0]._itype != -1 && plr[myplr].SpdList[0]._itype != 11) { - UseInvItem(myplr, 47); + UseInvItem(myplr, INVITEM_BELT_FIRST); } return; case '@': case '2': if (plr[myplr].SpdList[1]._itype != -1 && plr[myplr].SpdList[1]._itype != 11) { - UseInvItem(myplr, 48); + UseInvItem(myplr, INVITEM_BELT_FIRST + 1); } return; case '#': case '3': if (plr[myplr].SpdList[2]._itype != -1 && plr[myplr].SpdList[2]._itype != 11) { - UseInvItem(myplr, 49); + UseInvItem(myplr, INVITEM_BELT_FIRST + 2); } return; case '$': case '4': if (plr[myplr].SpdList[3]._itype != -1 && plr[myplr].SpdList[3]._itype != 11) { - UseInvItem(myplr, 50); + UseInvItem(myplr, INVITEM_BELT_FIRST + 3); } return; case '%': case '5': if (plr[myplr].SpdList[4]._itype != -1 && plr[myplr].SpdList[4]._itype != 11) { - UseInvItem(myplr, 51); + UseInvItem(myplr, INVITEM_BELT_FIRST + 4); } return; case '^': case '6': if (plr[myplr].SpdList[5]._itype != -1 && plr[myplr].SpdList[5]._itype != 11) { - UseInvItem(myplr, 52); + UseInvItem(myplr, INVITEM_BELT_FIRST + 5); } return; case '&': case '7': if (plr[myplr].SpdList[6]._itype != -1 && plr[myplr].SpdList[6]._itype != 11) { - UseInvItem(myplr, 53); + UseInvItem(myplr, INVITEM_BELT_FIRST + 6); } return; case '*': @@ -1383,7 +1383,7 @@ void PressChar(int vkey) } #endif if (plr[myplr].SpdList[7]._itype != -1 && plr[myplr].SpdList[7]._itype != 11) { - UseInvItem(myplr, 54); + UseInvItem(myplr, INVITEM_BELT_FIRST + 7); } return; #ifdef _DEBUG diff --git a/Source/inv.cpp b/Source/inv.cpp index 9ffbb043d..e1e245307 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -426,30 +426,30 @@ void DrawInvBelt() continue; } - InvDrawSlotBack(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, 28, 28); + InvDrawSlotBack(InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, 28, 28); frame = plr[myplr].SpdList[i]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; - if (pcursinvitem == i + 47) { + if (pcursinvitem == i + INVITEM_BELT_FIRST) { colour = ICOL_WHITE; if (plr[myplr].SpdList[i]._iMagical) colour = ICOL_BLUE; if (!plr[myplr].SpdList[i]._iStatFlag) colour = ICOL_RED; - CelBlitOutline(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8); + CelBlitOutline(colour, InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].SpdList[i]._iStatFlag) - CelClippedDraw(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8); + CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, pCursCels, frame, frame_width, 0, 8); else - CelDrawLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + 64, InvRect[i + SLOTXY_BELT_FIRST].Y + 159, pCursCels, frame, frame_width, 0, 8, 1); if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable && plr[myplr].SpdList[i]._iStatFlag && plr[myplr].SpdList[i]._itype != ITYPE_GOLD) { fi = i + 49; ff = fontframe[gbFontTransTbl[fi]]; - CPrintString(InvRect[i + 65].X + 64 + PitchTbl[InvRect[i + 65].Y + 159] - fontkern[ff] + 28, ff, 0); + CPrintString(InvRect[i + SLOTXY_BELT_FIRST].X + 64 + PitchTbl[InvRect[i + SLOTXY_BELT_FIRST].Y + 159] - fontkern[ff] + 28, ff, 0); } } } @@ -2078,10 +2078,10 @@ BOOL UseStaff() void StartGoldDrop() { initialDropGoldIndex = pcursinvitem; - if (pcursinvitem <= 46) - initialDropGoldValue = plr[myplr].InvList[pcursinvitem - 7]._ivalue; + if (pcursinvitem <= INVITEM_INV_LAST) + initialDropGoldValue = plr[myplr].InvList[pcursinvitem - INVITEM_INV_FIRST]._ivalue; else - initialDropGoldValue = plr[myplr].SpdList[pcursinvitem - 47]._ivalue; + initialDropGoldValue = plr[myplr].SpdList[pcursinvitem - INVITEM_BELT_FIRST]._ivalue; dropGoldFlag = TRUE; dropGoldValue = 0; if (talkflag) diff --git a/Source/multi.cpp b/Source/multi.cpp index dcf954101..97b024ff3 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -351,7 +351,7 @@ void multi_mon_seeds() sgdwGameLoops++; l = _rotr(sgdwGameLoops, 8); - for (i = 0; i < 200; i++) + for (i = 0; i < MAXMONSTERS; i++) monster[i]._mAISeed = l + i; }