Merge branch 'main' into skidmark_matching

This commit is contained in:
Dethrace Engineering Department 2025-09-19 21:29:05 +12:00 committed by GitHub
commit 42a312b80b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -2146,11 +2146,11 @@ void LoadInterfaceStrings(void) {
gTrans_fonts[10] = &gFonts[kFont_DRKPLAQ1];
gTrans_fonts[11] = &gFonts[kFont_BUTTOUT1];
gTrans_fonts[12] = &gFonts[kFont_BUTTIN1];
#ifdef DETHRACE_FIX_BUGS
fclose(f);
#endif
}
#ifdef DETHRACE_FIX_BUGS
fclose(f);
#endif
}
// IDA: void __cdecl FlushInterfaceFonts()

View File

@ -184,7 +184,7 @@ int IRandomBetween(int pA, int pB) {
return num;
#else
// If RAND_MAX != 0x7fff, then use floating numbers (alternative is using modulo)
return pA + (int)((pB + 1 - pA) * (rand() / ((float)RAND_MAX + 1)));
return pA + (int)((pB + 1 - pA) * (rand() / (float)RAND_MAX));
#endif
}
@ -205,7 +205,11 @@ int IRandomPosNeg(int pN) {
// IDA: float __cdecl FRandomBetween(float pA, float pB)
// FUNCTION: CARM95 0x004c16bf
float FRandomBetween(float pA, float pB) {
#ifdef DETHRACE_FIX_BUGS
return (float)rand() * (pB - pA) / (float)RAND_MAX + pA;
#else
return (float)rand() * (pB - pA) / (RAND_MAX + 1) + pA;
#endif
}
// IDA: float __cdecl FRandomPosNeg(float pN)