From a3e3cd4c23de897bf26ac8b748aa5e92ae2f1301 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 5 May 2019 19:15:05 +0200 Subject: [PATCH 1/6] Clean up ADD_PlrStringXY --- Source/control.cpp | 85 ++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 52 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index c2e4fd901..ba6a9d838 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1798,8 +1798,7 @@ void PrintGameStr(int x, int y, char *str, int color) int off; off = PitchTbl[y + 160] + x + 64; while (*str) { - c = gbFontTransTbl[(BYTE)*str]; - str++; + c = gbFontTransTbl[(BYTE)*str++]; c = fontframe[c]; if (c) CPrintString(off, c, color); @@ -2034,47 +2033,31 @@ void DrawChr() void ADD_PlrStringXY(int x, int y, int width, char *pszStr, char col) { - int v5; // eax - char *v6; // edx - unsigned char v7; // al - int v8; // esi - int v9; // edi - int v10; // ecx - unsigned char v11; // bl - unsigned char v12; // al - int v13; // ebx - int widtha; // [esp+Ch] [ebp-4h] - int widthb; // [esp+Ch] [ebp-4h] + BYTE c; + char *tmp; + int nOffset, screen_x, line, widthOffset; - v5 = PitchTbl[y + 160]; - v6 = pszStr; - widtha = v5 + x + 64; - v7 = *pszStr; - v8 = width - x + 1; - v9 = 0; - v10 = 0; - if (*pszStr) { - v11 = *pszStr; - do { - ++v6; - v10 += fontkern[fontframe[gbFontTransTbl[v11]]] + 1; - v11 = *v6; - } while (*v6); - } - if (v10 < v8) - v9 = (v8 - v10) >> 1; - widthb = v9 + widtha; - while (v7) { - ++pszStr; - v12 = fontframe[gbFontTransTbl[v7]]; - v13 = v12; - v9 += fontkern[v12] + 1; - if (v12) { - if (v9 < v8) - CPrintString(widthb, v12, col); + nOffset = x + PitchTbl[y + 160] + 64; + widthOffset = width - x + 1; + line = 0; + screen_x = 0; + tmp = pszStr; + while (*tmp) { + c = gbFontTransTbl[(BYTE)*tmp++]; + screen_x += fontkern[fontframe[c]] + 1; + } + if (screen_x < widthOffset) + line = (widthOffset - screen_x) >> 1; + nOffset += line; + while (*pszStr) { + c = gbFontTransTbl[(BYTE)*pszStr++]; + c = fontframe[c]; + line += fontkern[c] + 1; + if (c) { + if (line < widthOffset) + CPrintString(nOffset, c, col); } - widthb += fontkern[v13] + 1; - v7 = *pszStr; + nOffset += fontkern[c] + 1; } } @@ -2438,7 +2421,7 @@ void DrawSpellBook() void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col) { - BYTE nCel; + BYTE c; char *tmp; int screen_x, line, width; @@ -2448,24 +2431,22 @@ void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col) screen_x = 0; tmp = pszStr; while (*tmp) { - nCel = gbFontTransTbl[(BYTE)*tmp]; - tmp++; - screen_x += fontkern[fontframe[nCel]] + 1; + c = gbFontTransTbl[(BYTE)*tmp++]; + screen_x += fontkern[fontframe[c]] + 1; } if (screen_x < 222) line = (222 - screen_x) >> 1; width += line; } while (*pszStr) { - nCel = gbFontTransTbl[(BYTE)*pszStr]; - pszStr++; - nCel = fontframe[nCel]; - line += fontkern[nCel] + 1; - if (nCel) { + c = gbFontTransTbl[(BYTE)*pszStr++]; + c = fontframe[c]; + line += fontkern[c] + 1; + if (c) { if (line <= 222) - CPrintString(width, nCel, col); + CPrintString(width, c, col); } - width += fontkern[nCel] + 1; + width += fontkern[c] + 1; } } From 7a6609ad8ad1a376069239b819e051b390e5880c Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 5 May 2019 19:23:03 +0200 Subject: [PATCH 2/6] Clean up MY_PlrStringXY --- Source/control.cpp | 67 +++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 40 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index ba6a9d838..aedcb7b5c 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2031,6 +2031,9 @@ void DrawChr() ADD_PlrStringXY(143, 332, 174, a4, a5[0]); } +/** + * @brief Identical to MY_PlrStringXY(x, y, width, pszStr, col, 1) + */ void ADD_PlrStringXY(int x, int y, int width, char *pszStr, char col) { BYTE c; @@ -2063,47 +2066,31 @@ void ADD_PlrStringXY(int x, int y, int width, char *pszStr, char col) void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base) { - char *v6; // ebx - unsigned char v7; // al - int v8; // edx - int v9; // esi - char *v10; // edi - unsigned char v11; // cl - unsigned char v12; // al - int v13; // edi - int widtha; // [esp+Ch] [ebp-4h] - int widthb; // [esp+Ch] [ebp-4h] - int v16; // [esp+18h] [ebp+8h] - - v6 = pszStr; - widtha = PitchTbl[y + 160] + x + 64; - v7 = *pszStr; - v8 = 0; - v9 = width - x + 1; - v16 = 0; - v10 = pszStr; - if (*pszStr) { - v11 = *pszStr; - do { - ++v10; - v8 += base + fontkern[fontframe[gbFontTransTbl[v11]]]; - v11 = *v10; - } while (*v10); - } - if (v8 < v9) - v16 = (v9 - v8) >> 1; - widthb = v16 + widtha; - while (v7) { - ++v6; - v12 = fontframe[gbFontTransTbl[v7]]; - v13 = v12; - v16 += base + fontkern[v12]; - if (v12) { - if (v16 < v9) - CPrintString(widthb, v12, col); + BYTE c; + char *tmp; + int nOffset, screen_x, line, widthOffset; + + nOffset = x + PitchTbl[y + 160] + 64; + widthOffset = width - x + 1; + line = 0; + screen_x = 0; + tmp = pszStr; + while (*tmp) { + c = gbFontTransTbl[(BYTE)*tmp++]; + screen_x += fontkern[fontframe[c]] + base; + } + if (screen_x < widthOffset) + line = (widthOffset - screen_x) >> 1; + nOffset += line; + while (*pszStr) { + c = gbFontTransTbl[(BYTE)*pszStr++]; + c = fontframe[c]; + line += fontkern[c] + base; + if (c) { + if (line < widthOffset) + CPrintString(nOffset, c, col); } - widthb += base + fontkern[v13]; - v7 = *v6; + nOffset += fontkern[c] + base; } } From d4437a923e8367bcaf7026acdfc5ab57c477ac97 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 5 May 2019 22:42:57 +0200 Subject: [PATCH 3/6] Clean control_print_info_str --- Source/control.cpp | 68 +++++++++++++++++----------------------------- Source/control.h | 2 +- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index aedcb7b5c..6af5b364e 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1742,55 +1742,37 @@ LABEL_33: // 4B8CC1: using guessed type char pcursobj; // 4B8CC2: using guessed type char pcursplr; -void control_print_info_str(int y, char *str, BOOLEAN center, int lines) -{ - int v4; // edi - char *v5; // ebx - unsigned char v6; // cl - signed int v7; // eax - char *v8; // esi - int v9; // eax - unsigned char v10; // esi - unsigned char v11; // al - int width; // [esp+18h] [ebp+Ch] - - v4 = 0; - v5 = str; - width = lineoffset[y + 4 * lines + lines]; +void control_print_info_str(int y, char *str, BOOL center, int lines) +{ + BYTE c; + char *tmp; + int screen_x, line, nOffset; + + line = 0; + nOffset = lineoffset[y + 4 * lines + lines]; if (center == 1) { - v6 = *str; - v7 = 0; - v8 = str; - if (!*str) - goto LABEL_14; - do { - ++v8; - v7 += fontkern[fontframe[gbFontTransTbl[v6]]] + 2; - v6 = *v8; - } while (*v8); - if (v7 < 288) - LABEL_14: - v4 = (288 - v7) >> 1; - width += v4; + screen_x = 0; + tmp = str; + while (*tmp) { + c = gbFontTransTbl[(BYTE)*tmp++]; + screen_x += fontkern[fontframe[c]] + 1; + } + if (screen_x < 288) + line = (288 - screen_x) >> 1; + nOffset += line; } - while (1) { - v11 = *v5; - if (!*v5) - break; - ++v5; - v9 = gbFontTransTbl[v11]; - _LOBYTE(v9) = fontframe[v9]; - v10 = (unsigned char)v9; - v4 += fontkern[(unsigned char)v9] + 2; - if ((_BYTE)v9) { - if (v4 < 288) { - CPrintString(width, v10, infoclr); + while (*str) { + c = gbFontTransTbl[(BYTE)*str++]; + c = fontframe[c]; + line += fontkern[c] + 2; + if (c) { + if (line < 288) { + CPrintString(nOffset, c, infoclr); } } - width += fontkern[v10] + 2; + nOffset += fontkern[c] + 2; } } -// 4B883C: using guessed type int infoclr; void PrintGameStr(int x, int y, char *str, int color) { diff --git a/Source/control.h b/Source/control.h index f1057c839..3202ef36b 100644 --- a/Source/control.h +++ b/Source/control.h @@ -85,7 +85,7 @@ void CheckBtnUp(); void FreeControlPan(); BOOL control_WriteStringToBuffer(BYTE *str); void DrawInfoBox(); -void control_print_info_str(int y, char *str, BOOLEAN center, int lines); +void control_print_info_str(int y, char *str, BOOL center, int lines); void PrintGameStr(int x, int y, char *str, int color); void DrawChr(); void ADD_PlrStringXY(int x, int y, int width, char *pszStr, char col); From 3c7165b1d8904c1be8d9008bbe4d70dfa276f1c3 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 5 May 2019 22:48:30 +0200 Subject: [PATCH 4/6] Clean up CheckPanelInfo --- Source/control.cpp | 159 +++++++++++++++++---------------------------- 1 file changed, 60 insertions(+), 99 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 6af5b364e..bfb41b889 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -573,10 +573,6 @@ void SetSpell() plr[myplr]._pRSplType = pSplType; } } -// 4B8834: using guessed type int pSpell; -// 4B8954: using guessed type int pSplType; -// 4B8C98: using guessed type int spselflag; -// 52571C: using guessed type int drawpanflag; void SetSpeedSpell(int slot) { @@ -621,7 +617,6 @@ void ToggleSpell(int slot) drawpanflag = 255; } } -// 52571C: using guessed type int drawpanflag; void CPrintString(int nOffset, int nCel, char col) { @@ -1261,7 +1256,6 @@ void ClearCtrlPan() DrawPanelBox(0, sgbPlrTalkTbl + 16, 640, 128, 64, 512); DrawInfoBox(); } -// 4B8840: using guessed type int sgbPlrTalkTbl; void DrawCtrlPan() { @@ -1334,7 +1328,6 @@ void DoSpeedBook() SetCursorPos(X, Y); } -// 4B8C98: using guessed type int spselflag; void DoPanBtn() { @@ -1364,21 +1357,16 @@ void control_set_button_down(int btn_id) void control_check_btn_press() { - int v0; // edx - int v1; // esi - - v0 = MouseX; - v1 = MouseY; if (MouseX >= PanBtnPos[3][0] && MouseX <= PanBtnPos[3][0] + PanBtnPos[3][2] && MouseY >= PanBtnPos[3][1] && MouseY <= PanBtnPos[3][1] + PanBtnPos[3][3]) { control_set_button_down(3); } - if (v0 >= PanBtnPos[6][0] - && v0 <= PanBtnPos[6][0] + PanBtnPos[6][2] - && v1 >= PanBtnPos[6][1] - && v1 <= PanBtnPos[6][1] + PanBtnPos[6][3]) { + if (MouseX >= PanBtnPos[6][0] + && MouseX <= PanBtnPos[6][0] + PanBtnPos[6][2] + && MouseY >= PanBtnPos[6][1] + && MouseY <= PanBtnPos[6][1] + PanBtnPos[6][3]) { control_set_button_down(6); } } @@ -1394,53 +1382,34 @@ void DoAutoMap() InitDiabloMsg(EMSG_NO_AUTOMAP_IN_TOWN); } } -// 679660: using guessed type char gbMaxPlayers; void CheckPanelInfo() { - int v0; // edi - int v1; // eax - int v2; // ecx - int v3; // ecx - int v4; // edi - int v5; // eax - int *v6; // edx - int v7; // ebx - int v8; // ebx - int *v9; // eax - signed int v10; // edx - int v11; // ecx - int v12; // [esp+10h] [ebp-4h] + int i, c, v, s; - v0 = 0; panelflag = 0; ClearPanel(); - if (numpanbtns > 0) { - do { - v1 = v0; - v2 = PanBtnPos[v0][0]; - if (MouseX >= v2 && MouseX <= v2 + PanBtnPos[v1][2]) { - v3 = PanBtnPos[v1][1]; - if (MouseY >= v3 && MouseY <= v3 + PanBtnPos[v1][3]) { - if (v0 == 7) { - if (FriendlyMode) - strcpy(infostr, "Player friendly"); - else - strcpy(infostr, "Player attack"); - } else { - strcpy(infostr, PanBtnStr[v0]); - } - if (PanBtnHotKey[v0]) { - sprintf(tempstr, "Hotkey : %s", PanBtnHotKey[v0]); - AddPanelString(tempstr, 1); - } - infoclr = COL_WHITE; - panelflag = 1; - pinfoflag = TRUE; - } + for (i = 0; i < numpanbtns; i++) { + if (MouseX >= PanBtnPos[i][0] + && MouseX <= PanBtnPos[i][0] + PanBtnPos[i][2] + && MouseY >= PanBtnPos[i][1] + && MouseY <= PanBtnPos[i][1] + PanBtnPos[i][3]) { + if (i != 7) { + strcpy(infostr, PanBtnStr[i]); + } else { + if (FriendlyMode) + strcpy(infostr, "Player friendly"); + else + strcpy(infostr, "Player attack"); } - ++v0; - } while (v0 < numpanbtns); + if (PanBtnHotKey[i]) { + sprintf(tempstr, "Hotkey : %s", PanBtnHotKey[i]); + AddPanelString(tempstr, 1); + } + infoclr = COL_WHITE; + panelflag = 1; + pinfoflag = TRUE; + } } if (!spselflag && MouseX >= 565 && MouseX < 621 && MouseY >= 416 && MouseY < 472) { strcpy(infostr, "Select current spell button"); @@ -1449,62 +1418,58 @@ void CheckPanelInfo() pinfoflag = TRUE; strcpy(tempstr, "Hotkey : 's'"); AddPanelString(tempstr, 1); - v4 = plr[myplr]._pRSpell; - if (v4 != -1) { - switch (_LOBYTE(plr[myplr]._pRSplType)) { + v = plr[myplr]._pRSpell; + if (v != -1) { + switch (plr[myplr]._pRSplType) { case RSPLTYPE_SKILL: - sprintf(tempstr, "%s Skill", spelldata[v4].sSkillText); - LABEL_54: + sprintf(tempstr, "%s Skill", spelldata[v].sSkillText); AddPanelString(tempstr, 1); break; case RSPLTYPE_SPELL: - sprintf(tempstr, "%s Spell", spelldata[v4].sNameText); + sprintf(tempstr, "%s Spell", spelldata[v].sNameText); AddPanelString(tempstr, 1); - v11 = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[v4]; - if (v11 < 0) - v11 = 0; - if (v11) - sprintf(tempstr, "Spell Level %i", v11); - else + c = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[v]; + if (c < 0) + c = 0; + if (!c) sprintf(tempstr, "Spell Level 0 - Unusable"); - goto LABEL_54; + else + sprintf(tempstr, "Spell Level %i", c); + AddPanelString(tempstr, 1); + break; case RSPLTYPE_SCROLL: - sprintf(tempstr, "Scroll of %s", spelldata[v4].sNameText); + sprintf(tempstr, "Scroll of %s", spelldata[v].sNameText); AddPanelString(tempstr, 1); - v12 = 0; - v5 = myplr; - if (plr[myplr]._pNumInv > 0) { - v6 = &plr[v5].InvList[0]._iMiscId; - v7 = plr[myplr]._pNumInv; - do { - if (*(v6 - 53) != -1 && (*v6 == IMISC_SCROLL || *v6 == IMISC_SCROLLT) && v6[1] == v4) - ++v12; - v6 += 92; - --v7; - } while (v7); + s = 0; + for (i = 0; i < plr[myplr]._pNumInv; i++) { + if (plr[myplr].InvList[i]._itype != -1 + && (plr[myplr].InvList[i]._iMiscId == IMISC_SCROLL || plr[myplr].InvList[i]._iMiscId == IMISC_SCROLLT) + && plr[myplr].InvList[i]._iSpell == v) { + s++; + } } - v8 = v12; - v9 = &plr[v5].SpdList[0]._iMiscId; - v10 = MAXBELTITEMS; - do { - if (*(v9 - 53) != -1 && (*v9 == IMISC_SCROLL || *v9 == IMISC_SCROLLT) && v9[1] == v4) - ++v8; - v9 += 92; - --v10; - } while (v10); - if (v8 == 1) + for (i = 0; i < MAXBELTITEMS; i++) { + if (plr[myplr].SpdList[i]._itype != -1 + && (plr[myplr].SpdList[i]._iMiscId == IMISC_SCROLL || plr[myplr].SpdList[i]._iMiscId == IMISC_SCROLLT) + && plr[myplr].SpdList[i]._iSpell == v) { + s++; + } + } + if (s == 1) strcpy(tempstr, "1 Scroll"); else - sprintf(tempstr, "%i Scrolls", v8); - goto LABEL_54; + sprintf(tempstr, "%i Scrolls", s); + AddPanelString(tempstr, 1); + break; case RSPLTYPE_CHARGES: - sprintf(tempstr, "Staff of %s", spelldata[v4].sNameText); + sprintf(tempstr, "Staff of %s", spelldata[v].sNameText); AddPanelString(tempstr, 1); if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges == 1) strcpy(tempstr, "1 Charge"); else sprintf(tempstr, "%i Charges", plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges); - goto LABEL_54; + AddPanelString(tempstr, 1); + break; } } } @@ -1592,10 +1557,6 @@ void CheckBtnUp() if (gamemenuOff) gamemenu_off(); } -// 484368: using guessed type int FriendlyMode; -// 4B8960: using guessed type int talkflag; -// 4B8968: using guessed type int sbookflag; -// 646D00: using guessed type char qtextflag; void FreeControlPan() { From 0dd98cab274cb130aaf0fc14675670ad14db20d1 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 7 May 2019 00:28:49 +0200 Subject: [PATCH 5/6] Clean up trigs --- Source/cursor.cpp | 6 +++--- Source/trigs.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cursor.cpp b/Source/cursor.cpp index f88b83507..80b2044ea 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -127,7 +127,7 @@ void CheckTown() || cursmx == missile[mx]._mix - 2 && cursmy == missile[mx]._miy - 2 || cursmx == missile[mx]._mix - 1 && cursmy == missile[mx]._miy - 2 || cursmx == missile[mx]._mix && cursmy == missile[mx]._miy) { - trigflag = 1; + trigflag = TRUE; ClearPanel(); strcpy(infostr, "Town Portal"); sprintf(tempstr, "from %s", plr[missile[mx]._misource]._pName); @@ -153,7 +153,7 @@ void CheckRportal() || cursmx == missile[mx]._mix - 2 && cursmy == missile[mx]._miy - 2 || cursmx == missile[mx]._mix - 1 && cursmy == missile[mx]._miy - 2 || cursmx == missile[mx]._mix && cursmy == missile[mx]._miy) { - trigflag = 1; + trigflag = TRUE; ClearPanel(); strcpy(infostr, "Portal to"); if (!setlevel) @@ -261,7 +261,7 @@ void CheckCursMove() pcursplr = -1; uitemflag = 0; panelflag = 0; - trigflag = 0; + trigflag = FALSE; if(plr[myplr]._pInvincible) { return; diff --git a/Source/trigs.cpp b/Source/trigs.cpp index e4634bc63..090862aea 100644 --- a/Source/trigs.cpp +++ b/Source/trigs.cpp @@ -101,8 +101,8 @@ void InitTownTriggers() numtrigs = 1; - if(gbMaxPlayers == 4) { - for(i = 0; i < 3; i++) { + if(gbMaxPlayers == MAX_PLRS) { + for(i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) { townwarps[i] = TRUE; } trigs[1]._tx = 49; From aa2752839a7616edf781847025d20495b5c4a2db Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 7 May 2019 00:50:07 +0200 Subject: [PATCH 6/6] Clean up switch style --- Source/automap.cpp | 11 ++++++----- Source/control.cpp | 2 -- Source/list.h | 1 + Source/stores.cpp | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/automap.cpp b/Source/automap.cpp index e32cf790c..c351b1be2 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -499,6 +499,7 @@ void DrawAutomapPlr() DrawLine(x, y, x - AutoMapYPos, y - AMPlayerX, COLOR_PLAYER); DrawLine(x - AutoMapYPos, y - AMPlayerX, x - AMPlayerX, y - AMPlayerX, COLOR_PLAYER); DrawLine(x - AutoMapYPos, y - AMPlayerX, x - AMPlayerY - AMPlayerX, y, COLOR_PLAYER); + break; } } @@ -589,7 +590,7 @@ void SetAutomapView(int x, int y) } else if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) { automapview[xx - 1][yy] = 1; } - return; + break; case 3: if (solid) { if (GetAutomapType(xx + 1, yy, FALSE) == 0x4007) @@ -597,7 +598,7 @@ void SetAutomapView(int x, int y) } else if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) { automapview[xx][yy - 1] = 1; } - return; + break; case 4: if (solid) { if (GetAutomapType(xx, yy + 1, FALSE) == 0x4007) @@ -612,7 +613,7 @@ void SetAutomapView(int x, int y) if (GetAutomapType(xx - 1, yy - 1, FALSE) & 0x4000) automapview[xx - 1][yy - 1] = 1; } - return; + break; case 5: if (solid) { if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) @@ -622,7 +623,7 @@ void SetAutomapView(int x, int y) } else if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) { automapview[xx - 1][yy] = 1; } - return; + break; case 6: if (solid) { if (GetAutomapType(xx - 1, yy, FALSE) & 0x4000) @@ -632,7 +633,7 @@ void SetAutomapView(int x, int y) } else if (GetAutomapType(xx, yy - 1, FALSE) & 0x4000) { automapview[xx][yy - 1] = 1; } - return; + break; } } diff --git a/Source/control.cpp b/Source/control.cpp index bfb41b889..d13865482 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2175,8 +2175,6 @@ int DrawDurIcon4Item(ItemStruct *item, int x, int frame) case ITYPE_STAFF: frame = 8; break; - default: - break; } } else { frame = 1; diff --git a/Source/list.h b/Source/list.h index 6009b153e..e381c9cee 100644 --- a/Source/list.h +++ b/Source/list.h @@ -151,6 +151,7 @@ void TList::Insert(T *node, InsertPos pos, T *ref) break; case BEFORE: i->InsertBefore(node, reflink); + break; } } diff --git a/Source/stores.cpp b/Source/stores.cpp index 2729a6630..dd9730c6b 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -1818,19 +1818,19 @@ void S_SmithEnter() gossipstart = QUEST_GRISWOLD2; gossipend = QUEST_GRISWOLD13; StartStore(STORE_GOSSIP); - return; + break; case 12: StartStore(STORE_SBUY); - return; + break; case 14: StartStore(STORE_SPBUY); - return; + break; case 16: StartStore(STORE_SSELL); - return; + break; case 18: StartStore(STORE_SREPAIR); - return; + break; case 20: stextflag = STORE_NONE; break; @@ -2536,20 +2536,20 @@ void S_HealerEnter() gossipstart = QUEST_PEPIN2; gossipend = QUEST_PEPIN11; StartStore(STORE_GOSSIP); - return; + break; case 14: if (plr[myplr]._pHitPoints != plr[myplr]._pMaxHP) PlaySFX(IS_CAST8); drawhpflag = TRUE; plr[myplr]._pHitPoints = plr[myplr]._pMaxHP; plr[myplr]._pHPBase = plr[myplr]._pMaxHPBase; - return; + break; case 16: StartStore(STORE_HBUY); - return; + break; case 18: stextflag = STORE_NONE; - return; + break; } }