Skip to content

Commit

Permalink
Fix debug build as C (#566)
Browse files Browse the repository at this point in the history
* Clean up todo

* Fix debug build
  • Loading branch information
AJenbo authored and mewmew committed Jan 14, 2019
1 parent 3812287 commit 429ecec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
4 changes: 3 additions & 1 deletion Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion Source/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Source/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
29 changes: 9 additions & 20 deletions docs/TODO.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 429ecec

Please sign in to comment.