diff --git a/IIIFix/IIIFix.vcxproj b/IIIFix/IIIFix.vcxproj
index 554b9ca..1a18626 100644
--- a/IIIFix/IIIFix.vcxproj
+++ b/IIIFix/IIIFix.vcxproj
@@ -77,7 +77,7 @@
5.0
- Winmm.lib
+ Winmm.lib;%(AdditionalDependencies)
copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto 3\SilentPatchIII.asi"
@@ -108,7 +108,7 @@
5.0
- Winmm.lib
+ Winmm.lib;%(AdditionalDependencies)
copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto 3\SilentPatchIII.asi"
diff --git a/IIIFix/SilentPatchIII.cpp b/IIIFix/SilentPatchIII.cpp
index 32ce5e4..9d46892 100644
--- a/IIIFix/SilentPatchIII.cpp
+++ b/IIIFix/SilentPatchIII.cpp
@@ -3,6 +3,20 @@
#include "General.h"
#include "Timer.h"
+struct PsGlobalType
+{
+ HWND window;
+ DWORD instance;
+ DWORD fullscreen;
+ DWORD lastMousePos_X;
+ DWORD lastMousePos_Y;
+ DWORD unk;
+ DWORD diInterface;
+ DWORD diMouse;
+ void* diDevice1;
+ void* diDevice2;
+};
+
struct RsGlobalType
{
const char* AppName;
@@ -11,12 +25,14 @@ struct RsGlobalType
signed int MaximumHeight;
unsigned int frameLimit;
BOOL quit;
- void* ps;
+ PsGlobalType* ps;
void* keyboard;
void* mouse;
void* pad;
};
+
+
struct RwV2d
{
float x; /**< X value*/
@@ -87,8 +103,11 @@ static void (* const ConstructRenderList)() = AddressByVersion(0x4A76
static void (* const RsMouseSetPos)(RwV2d*) = AddressByVersion(0x580D20, 0x581070, 0x580F70);
void ResetMousePos()
{
- RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f };
- RsMouseSetPos(&vecPos);
+ if ( RsGlobal->ps->window == GetFocus() )
+ {
+ RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f };
+ RsMouseSetPos(&vecPos);
+ }
ConstructRenderList();
}