it's simple
for 1.04D, made it long ago
PHP Code:
const int CharRotFix1_Offset = 0x58E282;
const int CharRotFix2_Offset = 0x58E51F;
const int DamgRotPatch_Offset = 0x64298F;
const int DamgRotCall_Offset = 0x64299A;
// fix char rot
WriteCall(CharRotFix1_Offset, (DWORD)CharRotFix1);
WriteCall(CharRotFix2_Offset, (DWORD)CharRotFix2);
// call to RotateDmg
char patch[] = {0x8D, 0x45, 0xF8, 0x8D, 0x4D, 0xF4,
0xFF, 0x75, 0x18, 0x50, 0x51, 0xE8,
0x61, 0xD6, 0x9B, 0xFF, 0x83, 0xC4,
0x0C, 0xE9, 0x0A, 0xFF, 0xFF, 0xFF};
memcpy((LPVOID)DamgRotPatch_Offset, patch, sizeof(patch));
WriteCall(DamgRotCall_Offset, (DWORD)&RotateDmg);
__declspec(naked) void CharRotFix1()
{
__asm
{
add eax, 0x168
add eax, zRot
retn
}
}
__declspec(naked) void CharRotFix2()
{
__asm
{
mov ecx, 0x168
sub ecx, zRot
retn
}
}
const float rad = 0.01745329;
void RotateDmg(float& x, float& y, float d)
{
float sinTh = sin(rad*dCamRot.zRot);
float cosTh = cos(rad*dCamRot.zRot);
x += d/0.7071067*cosTh/2;
y -= d/0.7071067*sinTh/2;
}