diff --git a/Source/debug.cpp b/Source/debug.cpp index 043c81a9e..152f21240 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -95,7 +95,9 @@ void __cdecl TakeGoldCheat() void __cdecl MaxSpellsCheat() { - for (int i = 1; i < MAX_SPELLS; i++) { + int i; + + for (i = 1; i < MAX_SPELLS; i++) { if (spelldata[i].sBookLvl != -1) { plr[myplr]._pMemSpells |= (__int64)1 << (i - 1); plr[myplr]._pSplLvl[i] = 10; diff --git a/Source/sound.cpp b/Source/sound.cpp index 9376eb0d9..a37ec3223 100644 --- a/Source/sound.cpp +++ b/Source/sound.cpp @@ -449,13 +449,15 @@ void __cdecl music_stop() void __fastcall music_start(int nTrack) { + BOOL success; + /// ASSERT: assert((DWORD) nTrack < NUM_MUSIC); music_stop(); if (sglpDS && gbMusicOn) { #ifdef _DEBUG SFileEnableDirectAccess(FALSE); #endif - BOOL success = SFileOpenFile(sgszMusicTracks[nTrack], &sgpMusicTrack); + success = SFileOpenFile(sgszMusicTracks[nTrack], &sgpMusicTrack); #ifdef _DEBUG SFileEnableDirectAccess(TRUE); #endif diff --git a/Source/spells.cpp b/Source/spells.cpp index b82dc7903..50543713c 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -127,12 +127,14 @@ void __fastcall UseMana(int id, int sn) BOOL __fastcall CheckSpell(int id, int sn, BYTE st, BOOL manaonly) { + BOOL result; + #ifdef _DEBUG if (debug_mode_key_inverted_v) return TRUE; #endif - BOOL result = TRUE; + result = TRUE; if (!manaonly && pcurs != 1) { result = FALSE; } else { diff --git a/docs/TODO.md b/docs/TODO.md index 263ccf749..c4ebc0c72 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -1,20 +1,9 @@ -### Comments -- `BUGFIX` known bugs in original (vanilla) code -- `/* */` block comments are things to be fixed/checked -- `FIX_ME` bad data - -### Known Bugs -Serious bugs (crash/fault) -- TBA - -Minor bugs (noticeable but can be avoided) -- Server commands are broken and have been disabled `msgcmd.cpp` - -Code issues (incorrect code that still works) -- Critical sections should be constructors using `CCritSect` -- Some code uses macros such as `__ROL4__` -- Some functions/structures have incorrect signing (signed/unsigned BYTE) -- Function `GetLevelMTypes`, decompile and check `monster.cpp` -- Function `SetAutomapView`, decompile and check `automap.cpp` -- Function `engine_draw_automap_pixels`, decompile and check `engine.cpp` -- Double check `LOBYTE` of function `random(int, int)` +### Comments +- `BUGFIX` known bugs in original (vanilla) code +- `/* */` block comments are things to be fixed/checked +- `FIX_ME` bad data + +Code issues (incorrect code that still works) +- Critical sections should be constructors using `CCritSect` +- Some code uses macros such as `__ROL2__` +- Some functions/structures have incorrect signing (signed/unsigned BYTE)