hedgewars/uCursor.pas
changeset 13536 282218ab1b28
parent 13499 424944a835a7
child 14289 a3531b520efb
--- a/hedgewars/uCursor.pas	Sat Jul 21 02:19:32 2018 +0300
+++ b/hedgewars/uCursor.pas	Fri Jul 20 20:00:52 2018 -0400
@@ -9,7 +9,7 @@
 
 implementation
 
-uses SDLh, uVariables;
+uses SDLh, uVariables, uTypes;
 
 procedure init;
 begin
@@ -18,6 +18,8 @@
 
 procedure resetPosition;
 begin
+    if GameType = gmtRecord then
+        exit;
     // Move curser by 1px in case it's already centered.
     // The game camera in the Alpha for 0.9.23 screwed up if
     // the game started with the mouse already being centered.
@@ -31,13 +33,14 @@
 procedure updatePosition;
 var x, y: LongInt;
 begin
-    SDL_GetMouseState(@x, @y);
+    if GameType <> gmtRecord then
+        SDL_GetMouseState(@x, @y);
 
     if(x <> cScreenWidth div 2) or (y <> cScreenHeight div 2) then
     begin
         handlePositionUpdate(x - cScreenWidth div 2, y - cScreenHeight div 2);
 
-        if cHasFocus then
+        if cHasFocus and (GameType <> gmtRecord) then
             SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
     end
 end;