Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <math.h>
- #include <CPatch.h>
- double NormalisePoint(float *);
- float gRadarCircle = 0.000001;
- BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved)
- {
- if(reason == DLL_PROCESS_ATTACH)
- {
- CPatch::SetPointer(0x58585C, &gRadarCircle);
- CPatch::RedirectCall(0x5751F2 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x32A , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x396 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x416 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x49E , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x51E , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x659 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x93F , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xAD7 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xB5B , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xC37 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xCE7 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xD9F , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xE53 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0xF87 , NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x100B, NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x111C, NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x11A3, NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x12B7, NormalisePoint);
- CPatch::RedirectCall(0x5773D0+0x1343, NormalisePoint);
- CPatch::RedirectCall(0x585B20+0x76 , NormalisePoint);
- CPatch::RedirectCall(0x586E97 , NormalisePoint);
- CPatch::RedirectCall(0x587221 , NormalisePoint);
- CPatch::RedirectCall(0x587604 , NormalisePoint);
- CPatch::RedirectCall(0x58798F , NormalisePoint);
- CPatch::RedirectCall(0x588161 , NormalisePoint);
- CPatch::RedirectCall(0x58820D , NormalisePoint);
- }
- return TRUE;
- }
- double NormalisePoint(float *pos)
- {
- double r, angle;
- if(READCHAR(0xBA67A1))
- r = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
- else
- {
- r = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
- if(r > 1.0)
- {
- if(pos[0] > -1.0 && pos[0] < 1.0 && pos[1] > -1.0 && pos[1] < 1.0)
- r = 0.99;
- else
- {
- angle = atan2(pos[1], pos[0]) * 57.295779513 + 180.0;
- if(angle <= 45 || angle > 315)
- {
- pos[0] = 1.0;
- pos[1] = sin(angle / 57.295779513) * 1.4142135623;
- }
- else if(angle > 45 && angle <= 135)
- {
- pos[0] = cos(angle / 57.295779513) * 1.4142135623;
- pos[1] = 1.0;
- }
- else if(angle > 135 && angle <= 225)
- {
- pos[0] = -1.0;
- pos[1] = sin(angle / 57.295779513) * 1.4142135623;
- }
- else
- {
- pos[0] = cos(angle / 57.295779513) * 1.4142135623;
- pos[1] = -1.0;
- }
- }
- }
- }
- return r;
- }
Advertisement
Add Comment
Please, Sign In to add comment