diff --git a/src/drivers/human/human.cpp b/src/drivers/human/human.cpp index 0cc009ea..52f37387 100644 --- a/src/drivers/human/human.cpp +++ b/src/drivers/human/human.cpp @@ -549,6 +549,7 @@ common_drive(const int index, tCarElt* car, tSituation *s) { if (HCtx[idx]->mouseControlUsed) { GfuiMouseShow(); + GfctrlMouseCenter(); GfctrlMouseInitCenter(); } GfuiKeyEventRegisterCurrent(onKeyAction); diff --git a/src/libs/tgfclient/gui.cpp b/src/libs/tgfclient/gui.cpp index 393c8733..622c2b7d 100644 --- a/src/libs/tgfclient/gui.cpp +++ b/src/libs/tgfclient/gui.cpp @@ -394,6 +394,8 @@ tMouseInfo *GfuiMouseInfo(void) void GfuiMouseSetPos(int x, int y) { SDL_WarpMouse(x,y); + GfuiMouse.X = (x - (ScrW - ViewW)/2) * (int)GfuiScreen->width / ViewW; + GfuiMouse.Y = (ViewH - y + (ScrH - ViewH)/2) * (int)GfuiScreen->height / ViewH; }