fixed CFileMgr, the craziest bug i ever had

This commit is contained in:
aap 2019-06-28 21:24:22 +02:00
parent 48cf8b6629
commit 0711bfacd4
4 changed files with 5 additions and 8 deletions

View File

@ -265,10 +265,10 @@ CFileMgr::Seek(int fd, int offset, int whence)
return !!myfseek(fd, offset, whence);
}
char*
bool
CFileMgr::ReadLine(int fd, char *buf, int len)
{
return myfgets(buf, len, fd);
return myfgets(buf, len, fd) != nil;
}
int

View File

@ -15,7 +15,7 @@ public:
static int Read(int fd, char *buf, int len);
static int Write(int fd, char *buf, int len);
static bool Seek(int fd, int offset, int whence);
static char *ReadLine(int fd, char *buf, int len);
static bool ReadLine(int fd, char *buf, int len);
static int CloseFile(int fd);
static int GetErrorReadWrite(int fd);
};

View File

@ -90,17 +90,12 @@ void PrintGameVersion();
RwRGBA gColourTop;
#ifndef DEBUG
// This is the weirdest shit. In Debug this causes my game to crash in CPed::IsPedInControl shortly after level change
void
InitialiseGame(void)
{
LoadingScreen(nil, nil, "loadsc0");
CGame::Initialise("DATA\\GTA3.DAT");
}
#else
WRAPPER void InitialiseGame(void) { EAXJMP(0x48E7E0); }
#endif
void
Idle(void *arg)

View File

@ -344,6 +344,8 @@ patch()
Patch<float>(0x46BC61+6, 1.0f); // car distance
InjectHook(0x59E460, printf, PATCH_JUMP);
InjectHook(0x475E00, printf, PATCH_JUMP); // _Error
// stolen from silentpatch (sorry)
Patch<WORD>(0x5382BF, 0x0EEB);