Code corrections

This commit is contained in:
NovaRain
2021-09-07 06:37:57 +08:00
parent 6c3dd72ea7
commit f6c1e0f908
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -781,7 +781,7 @@ static void __declspec(naked) wmInterfaceRefreshCarFuel_hack() {
}
}
static void __declspec(naked) register_button() {
static void __declspec(naked) wmInterfaceInit_hook() {
static DWORD retAddr;
__asm {
pop retAddr;
@@ -805,7 +805,7 @@ static void WorldMapInterfacePatch() {
}
// Add missing sounds for the buttons on the world map interface (wmInterfaceInit_)
HookCalls(register_button, {
HookCalls(wmInterfaceInit_hook, {
0x4C2BF4, // location labels
0x4C2BB5, // town/world
0x4C2D4C, // up
+4 -2
View File
@@ -129,8 +129,10 @@ static DWORD __stdcall FakeGetTickCount() {
lastTickCount = newTickCount;
// Multiply the tick count difference by the multiplier
long mode = GetLoopFlags();
if (IsGameLoaded() && enabled && (!mode || (mode & (LoopFlag::WORLDMAP | LoopFlag::PCOMBAT | LoopFlag::COMBAT))) && !slideShow) {
long mode;
if (IsGameLoaded() && enabled &&
(!(mode = GetLoopFlags()) || mode == LoopFlag::COMBAT || mode == (LoopFlag::COMBAT | LoopFlag::PCOMBAT) || (mode & LoopFlag::WORLDMAP)) && !slideShow)
{
elapsed *= multi;
elapsed += tickCountFraction;
tickCountFraction = modf(elapsed, &elapsed);
+1 -1
View File
@@ -97,7 +97,7 @@ bool hrpVersionValid = false; // HRP 4.1.8 version validation
static DWORD hrpDLLBaseAddr = 0x10000000;
DWORD HRPAddress(DWORD addr) {
return (hrpDLLBaseAddr | (addr & 0xFFFFF));
return (hrpDLLBaseAddr + (addr & 0xFFFFF));
}
char falloutConfigName[65];