Fix debug build as C (#566)

* Clean up todo

* Fix debug build
This commit is contained in:
Anders Jenbo 2019-01-14 18:54:12 +01:00 committed by Robin Eklind
commit 429ececce0
4 changed files with 18 additions and 23 deletions

View file

@ -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;

View file

@ -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

View file

@ -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 {

View file

@ -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)