diff --git a/Source/automap.cpp b/Source/automap.cpp index ea123f573..85855b5bc 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -351,6 +351,7 @@ void DrawAutomapPlr(CelOutputBuffer out, int pnum) DrawLineTo(out, x + AmLine16, y + AmLine8, x + AmLine8, y + AmLine8, playerColor); break; case DIR_S: + case DIR_OMNI: DrawLineTo(out, x, y, x, y + AmLine16, playerColor); DrawLineTo(out, x, y + AmLine16, x + AmLine4, y + AmLine8, playerColor); DrawLineTo(out, x, y + AmLine16, x - AmLine4, y + AmLine8, playerColor); diff --git a/Source/control.cpp b/Source/control.cpp index 5c8ae1b55..202bead34 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -367,6 +367,8 @@ void DrawSpellList(CelOutputBuffer out) mask = plr[myplr]._pISpells; c = SPLICONLAST + 2; break; + case RSPLTYPE_INVALID: + break; } Sint32 j = SPL_FIREBOLT; for (spl = 1; j < MAX_SPELLS; spl <<= 1, j++) { @@ -440,6 +442,8 @@ void DrawSpellList(CelOutputBuffer out) sprintf(tempstr, "%i Charges", plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges); AddPanelString(tempstr, TRUE); break; + case RSPLTYPE_INVALID: + break; } for (t = 0; t < 4; t++) { if (plr[myplr]._pSplHotKey[t] == pSpell && plr[myplr]._pSplTHotKey[t] == pSplType) { @@ -510,6 +514,8 @@ void ToggleSpell(int slot) case RSPLTYPE_CHARGES: spells = plr[myplr]._pISpells; break; + case RSPLTYPE_INVALID: + return; } if (spells & GetSpellBitmask(plr[myplr]._pSplHotKey[slot])) { @@ -1068,6 +1074,8 @@ void CheckPanelInfo() sprintf(tempstr, "%i Charges", plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges); AddPanelString(tempstr, TRUE); break; + case RSPLTYPE_INVALID: + break; } } } @@ -1678,26 +1686,25 @@ static int DrawDurIcon4Item(CelOutputBuffer out, ItemStruct *pItem, int x, int c if (pItem->_iDurability > 5) return x; if (c == 0) { - if (pItem->_iClass == ICLASS_WEAPON) { - switch (pItem->_itype) { - case ITYPE_SWORD: - c = 2; - break; - case ITYPE_AXE: - c = 6; - break; - case ITYPE_BOW: - c = 7; - break; - case ITYPE_MACE: - c = 5; - break; - case ITYPE_STAFF: - c = 8; - break; - } - } else { + switch (pItem->_itype) { + case ITYPE_SWORD: + c = 2; + break; + case ITYPE_AXE: + c = 6; + break; + case ITYPE_BOW: + c = 7; + break; + case ITYPE_MACE: + c = 5; + break; + case ITYPE_STAFF: + c = 8; + break; + default: c = 1; + break; } } if (pItem->_iDurability > 2) diff --git a/Source/inv.cpp b/Source/inv.cpp index 9f94b2b22..9c93eadae 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1785,10 +1785,11 @@ void CheckInvCut(int pnum, int mx, int my, bool automaticMove) case PC_SORCERER: PlaySFX(PS_MAGE15, false); break; - case PC_MONK: PlaySFX(PS_MONK15, false); break; + case NUM_CLASSES: + break; } } else { switch (player._pClass) { @@ -1796,19 +1797,18 @@ void CheckInvCut(int pnum, int mx, int my, bool automaticMove) case PC_BARBARIAN: PlaySFX(PS_WARR37, false); break; - case PC_ROGUE: case PC_BARD: PlaySFX(PS_ROGUE37, false); break; - case PC_SORCERER: PlaySFX(PS_MAGE37, false); break; - case PC_MONK: PlaySFX(PS_MONK37, false); break; + case NUM_CLASSES: + break; } } } diff --git a/Source/items.cpp b/Source/items.cpp index 5b505c5b1..0e21b05f5 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -1451,6 +1451,8 @@ void CreatePlrItems(int p) SetPlrHandItem(&plr[p].SpdList[1], IDI_HEAL); GetPlrHandSeed(&plr[p].SpdList[1]); break; + case NUM_CLASSES: + break; } SetPlrHandItem(&plr[p].HoldItem, IDI_GOLD); @@ -2405,39 +2407,41 @@ void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood) void GetItemBonus(int i, int idata, int minlvl, int maxlvl, BOOL onlygood, BOOLEAN allowspells) { - if (item[i]._iClass != ICLASS_GOLD) { - if (minlvl > 25) - minlvl = 25; + if (minlvl > 25) + minlvl = 25; - switch (item[i]._itype) { - case ITYPE_SWORD: - case ITYPE_AXE: - case ITYPE_MACE: - GetItemPower(i, minlvl, maxlvl, PLT_WEAP, onlygood); - break; - case ITYPE_BOW: - GetItemPower(i, minlvl, maxlvl, PLT_BOW, onlygood); - break; - case ITYPE_SHIELD: - GetItemPower(i, minlvl, maxlvl, PLT_SHLD, onlygood); - break; - case ITYPE_LARMOR: - case ITYPE_HELM: - case ITYPE_MARMOR: - case ITYPE_HARMOR: - GetItemPower(i, minlvl, maxlvl, PLT_ARMO, onlygood); - break; - case ITYPE_STAFF: - if (allowspells) - GetStaffSpell(i, maxlvl, onlygood); - else - GetItemPower(i, minlvl, maxlvl, PLT_STAFF, onlygood); - break; - case ITYPE_RING: - case ITYPE_AMULET: - GetItemPower(i, minlvl, maxlvl, PLT_MISC, onlygood); - break; - } + switch (item[i]._itype) { + case ITYPE_SWORD: + case ITYPE_AXE: + case ITYPE_MACE: + GetItemPower(i, minlvl, maxlvl, PLT_WEAP, onlygood); + break; + case ITYPE_BOW: + GetItemPower(i, minlvl, maxlvl, PLT_BOW, onlygood); + break; + case ITYPE_SHIELD: + GetItemPower(i, minlvl, maxlvl, PLT_SHLD, onlygood); + break; + case ITYPE_LARMOR: + case ITYPE_HELM: + case ITYPE_MARMOR: + case ITYPE_HARMOR: + GetItemPower(i, minlvl, maxlvl, PLT_ARMO, onlygood); + break; + case ITYPE_STAFF: + if (allowspells) + GetStaffSpell(i, maxlvl, onlygood); + else + GetItemPower(i, minlvl, maxlvl, PLT_STAFF, onlygood); + break; + case ITYPE_RING: + case ITYPE_AMULET: + GetItemPower(i, minlvl, maxlvl, PLT_MISC, onlygood); + break; + case ITYPE_NONE: + case ITYPE_MISC: + case ITYPE_GOLD: + break; } } @@ -3417,6 +3421,8 @@ static BOOL OilItem(ItemStruct *x, PlayerStruct *p) return FALSE; } break; + default: + break; } switch (p->_pOilType) { @@ -3497,6 +3503,8 @@ static BOOL OilItem(ItemStruct *x, PlayerStruct *p) x->_iAC += random_(68, 3) + 3; } break; + default: + return FALSE; } return TRUE; } @@ -5036,6 +5044,8 @@ void SpawnBoy(int lvl) if (itemType == ITYPE_BOW || itemType == ITYPE_STAFF) ivalue = INT_MAX; break; + case NUM_CLASSES: + break; } } } while ((item[0]._iIvalue > 200000 diff --git a/Source/objects.cpp b/Source/objects.cpp index 3fd324187..013705915 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -3478,6 +3478,8 @@ void OperateShrine(int pnum, int i, int sType) case ITYPE_HARMOR: plr[pnum].InvList[j]._iAC += 2; break; + default: + break; } } InitDiabloMsg(EMSG_SHRINE_GLOOMY); @@ -3955,6 +3957,8 @@ void OperateShrine(int pnum, int i, int sType) ModifyPlrDex(myplr, 1); ModifyPlrMag(myplr, 1); break; + case NUM_CLASSES: + break; } CheckStats(pnum); AddMissile( diff --git a/Source/player.cpp b/Source/player.cpp index 2c4c2c9c4..24e7e136a 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -2453,10 +2453,11 @@ BOOL PlrHitMonst(int pnum, int m) dam += dam >> 1; } break; - } - - if (plr[pnum]._pIFlags & ISPL_3XDAMVDEM && monster[m].MData->mMonstClass == MC_DEMON) { - dam *= 3; + case MC_DEMON: + if (plr[pnum]._pIFlags & ISPL_3XDAMVDEM) { + dam *= 3; + } + break; } if (plr[pnum].pDamAcFlags & 0x01 && random_(6, 100) < 5) { @@ -3301,6 +3302,8 @@ void CheckNewPath(int pnum) TalkToTowner(pnum, plr[pnum].destParam1); } break; + default: + break; } FixPlayerLocation(pnum, plr[pnum]._pdir); @@ -3489,7 +3492,6 @@ static void CheckCheatStats(int pnum) void ProcessPlayers() { int pnum; - BOOL tplayer; if ((DWORD)myplr >= MAX_PLRS) { app_fatal("ProcessPlayers: illegal player %d", myplr); @@ -3547,7 +3549,7 @@ void ProcessPlayers() } } - tplayer = FALSE; + bool tplayer = false; do { switch (plr[pnum]._pmode) { case PM_STAND: @@ -3579,6 +3581,9 @@ void ProcessPlayers() case PM_NEWLVL: tplayer = PM_DoNewLvl(pnum); break; + case PM_QUIT: + tplayer = false; + break; } CheckNewPath(pnum); } while (tplayer); @@ -3789,6 +3794,8 @@ void CheckPlrSpell() case RSPLTYPE_CHARGES: addflag = UseStaff(); break; + case RSPLTYPE_INVALID: + return; } if (addflag) { diff --git a/Source/stores.cpp b/Source/stores.cpp index 2db8e32b9..3921d7abc 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -1960,6 +1960,8 @@ void S_ConfirmEnter() case STORE_SPBUY: SmithBuyPItem(); break; + default: + break; } } @@ -2454,6 +2456,8 @@ void StartStore(talk_id s) case STORE_BARMAID: S_StartBarMaid(); break; + case STORE_NONE: + break; } stextsel = -1; @@ -2497,6 +2501,8 @@ void DrawSText(CelOutputBuffer out) case STORE_SPBUY: S_ScrollSPBuy(stextsval); break; + default: + break; } } @@ -2580,6 +2586,8 @@ void STextESC() stextsel = stextlhold; stextsval = stextvhold; break; + case STORE_NONE: + break; } } } @@ -2771,79 +2779,83 @@ void STextEnter() qtextflag = FALSE; if (leveltype == DTYPE_TOWN) stream_stop(); - } else { - PlaySFX(IS_TITLSLCT); - switch (stextflag) { - case STORE_SMITH: - S_SmithEnter(); - break; - case STORE_SPBUY: - S_SPBuyEnter(); - break; - case STORE_SBUY: - S_SBuyEnter(); - break; - case STORE_SSELL: - S_SSellEnter(); - break; - case STORE_SREPAIR: - S_SRepairEnter(); - break; - case STORE_WITCH: - S_WitchEnter(); - break; - case STORE_WBUY: - S_WBuyEnter(); - break; - case STORE_WSELL: - S_WSellEnter(); - break; - case STORE_WRECHARGE: - S_WRechargeEnter(); - break; - case STORE_NOMONEY: - case STORE_NOROOM: - StartStore(stextshold); - stextsel = stextlhold; - stextsval = stextvhold; - break; - case STORE_CONFIRM: - S_ConfirmEnter(); - break; - case STORE_BOY: - S_BoyEnter(); - break; - case STORE_BBOY: - S_BBuyEnter(); - break; - case STORE_HEALER: - S_HealerEnter(); - break; - case STORE_STORY: - S_StoryEnter(); - break; - case STORE_HBUY: - S_HBuyEnter(); - break; - case STORE_SIDENTIFY: - S_SIDEnter(); - break; - case STORE_GOSSIP: - S_TalkEnter(); - break; - case STORE_IDSHOW: - StartStore(STORE_SIDENTIFY); - break; - case STORE_DRUNK: - S_DrunkEnter(); - break; - case STORE_TAVERN: - S_TavernEnter(); - break; - case STORE_BARMAID: - S_BarmaidEnter(); - break; - } + + return; + } + + PlaySFX(IS_TITLSLCT); + switch (stextflag) { + case STORE_SMITH: + S_SmithEnter(); + break; + case STORE_SPBUY: + S_SPBuyEnter(); + break; + case STORE_SBUY: + S_SBuyEnter(); + break; + case STORE_SSELL: + S_SSellEnter(); + break; + case STORE_SREPAIR: + S_SRepairEnter(); + break; + case STORE_WITCH: + S_WitchEnter(); + break; + case STORE_WBUY: + S_WBuyEnter(); + break; + case STORE_WSELL: + S_WSellEnter(); + break; + case STORE_WRECHARGE: + S_WRechargeEnter(); + break; + case STORE_NOMONEY: + case STORE_NOROOM: + StartStore(stextshold); + stextsel = stextlhold; + stextsval = stextvhold; + break; + case STORE_CONFIRM: + S_ConfirmEnter(); + break; + case STORE_BOY: + S_BoyEnter(); + break; + case STORE_BBOY: + S_BBuyEnter(); + break; + case STORE_HEALER: + S_HealerEnter(); + break; + case STORE_STORY: + S_StoryEnter(); + break; + case STORE_HBUY: + S_HBuyEnter(); + break; + case STORE_SIDENTIFY: + S_SIDEnter(); + break; + case STORE_GOSSIP: + S_TalkEnter(); + break; + case STORE_IDSHOW: + StartStore(STORE_SIDENTIFY); + break; + case STORE_DRUNK: + S_DrunkEnter(); + break; + case STORE_TAVERN: + S_TavernEnter(); + break; + case STORE_BARMAID: + S_BarmaidEnter(); + break; + case STORE_NONE: + break; } }