mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-22 05:22:32 +01:00
Fix probabilities in CVehicle::InflictDamage incorrectly assuming a random range from 0 to 100.000
This commit is contained in:
parent
56ac3b8795
commit
d72a0cb7a0
@ -1393,6 +1393,16 @@ void Patch_III_Common()
|
||||
Nop(setEvasiveDive.get<void>(), 1);
|
||||
InjectHook(setEvasiveDive.get<void>(1), &CalculateAngle_Hook, HookType::Call);
|
||||
}
|
||||
|
||||
|
||||
// Fix probabilities in CVehicle::InflictDamage incorrectly assuming a random range from 0 to 100.000
|
||||
{
|
||||
auto probability_do_nothing = get_pattern("66 81 7E 5A ? ? 73 50", 4);
|
||||
auto probability_flee = get_pattern("0F B7 46 5A 3D ? ? ? ? 0F 8E", 4 + 1);
|
||||
|
||||
Patch<uint16_t>(probability_do_nothing, 35000u * 32767u / 100000u);
|
||||
Patch<uint32_t>(probability_flee, 75000u * 32767u / 100000u);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
|
@ -1289,6 +1289,14 @@ void Patch_VC_Common()
|
||||
Patch<uint8_t>(forAllAtomics.get<void>(), 0x53);
|
||||
InterceptCall(forAllAtomics.get<void>(1), orgRpClumpForAllAtomics, RpClumpForAllAtomics_ExtraComps);
|
||||
}
|
||||
|
||||
|
||||
// Fix probabilities in CVehicle::InflictDamage incorrectly assuming a random range from 0 to 100.000
|
||||
{
|
||||
auto probability = get_pattern("66 81 7B 5A ? ? 73 50", 4);
|
||||
|
||||
Patch<uint16_t>(probability, 35000u / 2u);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
|
Loading…
Reference in New Issue
Block a user