diff --git a/.travis.yml b/.travis.yml index 517aa12df..8eeb3810e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ language: cpp os: - linux - osx + +osx_image: xcode10.3 notifications: email: @@ -15,7 +17,6 @@ addons: homebrew: packages: - mingw-w64 - update: true env: - MAKE_BUILD=make diff --git a/Source/automap.cpp b/Source/automap.cpp index e4454f508..e9907cf9e 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -71,24 +71,21 @@ void InitAutomap() switch (leveltype) { case DTYPE_CATHEDRAL: pAFile = LoadFileInMem("Levels\\L1Data\\L1.AMP", &dwTiles); - dwTiles >>= 1; break; case DTYPE_CATACOMBS: pAFile = LoadFileInMem("Levels\\L2Data\\L2.AMP", &dwTiles); - dwTiles >>= 1; break; case DTYPE_CAVES: pAFile = LoadFileInMem("Levels\\L3Data\\L3.AMP", &dwTiles); - dwTiles >>= 1; break; case DTYPE_HELL: pAFile = LoadFileInMem("Levels\\L4Data\\L4.AMP", &dwTiles); - dwTiles >>= 1; break; default: return; } + dwTiles >>= 1; pTmp = pAFile; for (i = 1; i <= dwTiles; i++) { diff --git a/Source/engine.cpp b/Source/engine.cpp index 35ae01520..b5fd3d4d4 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -2301,12 +2301,13 @@ int GetDirection(int x1, int y1, int x2, int y2) if (2 * my < mx) return DIR_SE; } else { - ny = -mx; if (my >= 0) { + ny = -mx; md = DIR_W; if (2 * ny < my) md = DIR_SW; } else { + ny = -mx; my = -my; md = DIR_N; if (2 * ny < my) diff --git a/Source/monster.cpp b/Source/monster.cpp index f4b27792d..7bcb4f409 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -361,34 +361,22 @@ void InitMonsterGFX(int monst) MissileFileFlag |= 2; LoadMissileGFX(MFILE_THINLGHT); } - if (mtype == MT_SUCCUBUS) { - if (MissileFileFlag & 4) - return; - + if (mtype == MT_SUCCUBUS && !(MissileFileFlag & 4)) { MissileFileFlag |= 4; LoadMissileGFX(MFILE_FLARE); LoadMissileGFX(MFILE_FLAREEXP); } - if (mtype == MT_SNOWWICH) { - if (MissileFileFlag & 0x20) - return; - + if (mtype == MT_SNOWWICH && !(MissileFileFlag & 0x20)) { MissileFileFlag |= 0x20; LoadMissileGFX(MFILE_SCUBMISB); LoadMissileGFX(MFILE_SCBSEXPB); } - if (mtype == MT_HLSPWN) { - if (MissileFileFlag & 0x40) - return; - + if (mtype == MT_HLSPWN && !(MissileFileFlag & 0x40)) { MissileFileFlag |= 0x40; LoadMissileGFX(MFILE_SCUBMISD); LoadMissileGFX(MFILE_SCBSEXPD); } - if (mtype == MT_SOLBRNR) { - if (MissileFileFlag & 0x80) - return; - + if (mtype == MT_SOLBRNR && !(MissileFileFlag & 0x80)) { MissileFileFlag |= 0x80; LoadMissileGFX(MFILE_SCUBMISC); LoadMissileGFX(MFILE_SCBSEXPC); diff --git a/Source/spells.cpp b/Source/spells.cpp index aea7f5d16..bb1ba8eb1 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -138,7 +138,7 @@ void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int if (spelldata[spl].sMissiles[0] == MIS_CBOLT) { UseMana(id, SPL_CBOLT); - for (i = 0; i < (spllvl >> 1) + 3; i++) { + for (i = (spllvl >> 1) + 3; i > 0; i--) { AddMissile(sx, sy, dx, dy, dir, MIS_CBOLT, caster, id, 0, spllvl); } } diff --git a/Source/stores.cpp b/Source/stores.cpp index d61853247..23b524cf5 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -199,16 +199,17 @@ void PrintSString(int x, int y, BOOL cjustflag, char *str, char col, int val) void DrawSLine(int y) { - int xy, yy, width, line; + int xy, yy, width, line, sy; + sy = SStringY[y]; if (stextsize == 1) { xy = SCREENXY(26, 25); - yy = PitchTbl[SStringY[y] + 198] + 26 + 64; + yy = PitchTbl[sy + 198] + 26 + 64; width = 586 / 4; line = BUFFER_WIDTH - 586; } else { xy = SCREENXY(346, 25); - yy = PitchTbl[SStringY[y] + 198] + 346 + 64; + yy = PitchTbl[sy + 198] + 346 + 64; width = 266 / 4; line = BUFFER_WIDTH - 266; } @@ -330,9 +331,9 @@ void StoreAutoPlace() int i, w, h, idx; SetICursor(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM); - done = FALSE; w = icursW28; h = icursH28; + done = FALSE; if (w == 1 && h == 1) { idx = plr[myplr].HoldItem.IDidx; if (plr[myplr].HoldItem._iStatFlag && AllItemsList[idx].iUsable) { @@ -453,6 +454,8 @@ void S_ScrollSBuy(int idx) void PrintStoreItem(ItemStruct *x, int l, char iclr) { char sstr[128]; + char str, dex; + BYTE mag; sstr[0] = '\0'; if (x->_iIdentified) { @@ -492,7 +495,10 @@ void PrintStoreItem(ItemStruct *x, int l, char iclr) } if (!x->_itype) sstr[0] = '\0'; - if (!(x->_iMinStr + x->_iMinMag + x->_iMinDex)) { + str = x->_iMinStr; + dex = x->_iMinDex; + mag = x->_iMinMag; + if (!(str + mag + dex)) { strcat(sstr, "No required attributes"); } else { strcpy(tempstr, "Required:"); @@ -504,10 +510,10 @@ void PrintStoreItem(ItemStruct *x, int l, char iclr) sprintf(tempstr, "%s %i Dex", tempstr, x->_iMinDex); strcat(sstr, tempstr); } - AddSText(40, l, 0, sstr, iclr, 0); + AddSText(40, l++, 0, sstr, iclr, 0); if (x->_iMagical == ITEM_QUALITY_UNIQUE) { if (x->_iIdentified) - AddSText(40, l + 1, 0, "Unique Item", iclr, 0); + AddSText(40, l, 0, "Unique Item", iclr, 0); } } diff --git a/Source/towners.cpp b/Source/towners.cpp index e04e694dc..873fceaca 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -812,11 +812,11 @@ void TalkToTowner(int p, int t) towner[t]._tVar1 = p; quests[QTYPE_BUTCH]._qvar1 = 1; #ifndef SPAWN - if (plr[p]._pClass == 0 && !effect_is_playing(PS_WARR8)) { + if (plr[p]._pClass == PC_WARRIOR && !effect_is_playing(PS_WARR8)) { PlaySFX(PS_WARR8); - } else if (plr[p]._pClass == 1 && !effect_is_playing(PS_ROGUE8)) { + } else if (plr[p]._pClass == PC_ROGUE && !effect_is_playing(PS_ROGUE8)) { PlaySFX(PS_ROGUE8); - } else if (plr[p]._pClass == 2 && !effect_is_playing(PS_MAGE8)) { + } else if (plr[p]._pClass == PC_SORCERER && !effect_is_playing(PS_MAGE8)) { PlaySFX(PS_MAGE8); } #endif