DEADSOFTWARE

always calculate c and d in camera stuff
authorfgsfds <pvt.fgsfds@gmail.com>
Sun, 9 Feb 2020 02:42:48 +0000 (05:42 +0300)
committerfgsfds <pvt.fgsfds@gmail.com>
Sun, 9 Feb 2020 02:42:48 +0000 (05:42 +0300)
src/game/g_game.pas

index 87e4f907deffe20e42522d03beaa16593ae63fd1..854a15a978ea9dbb3faecef572e6973abaa77ebb 100644 (file)
@@ -3702,11 +3702,11 @@ begin
     if (sY+sHeight > gMapInfo.Height) then sY := gMapInfo.Height-sHeight;
     if (sX < 0) then sX := 0;
     if (sY < 0) then sY := 0;
-
-    if (gBackSize.X <= gPlayerScreenSize.X) or (gMapInfo.Width <= sWidth) then c := 0 else c := trunc((gBackSize.X-gPlayerScreenSize.X)*sX/(gMapInfo.Width-sWidth));
-    if (gBackSize.Y <= gPlayerScreenSize.Y) or (gMapInfo.Height <= sHeight) then d := 0 else d := trunc((gBackSize.Y-gPlayerScreenSize.Y)*sY/(gMapInfo.Height-sHeight));
   end;
 
+  if (gBackSize.X <= gPlayerScreenSize.X) or (gMapInfo.Width <= sWidth) then c := 0 else c := trunc((gBackSize.X-gPlayerScreenSize.X)*sX/(gMapInfo.Width-sWidth));
+  if (gBackSize.Y <= gPlayerScreenSize.Y) or (gMapInfo.Height <= sHeight) then d := 0 else d := trunc((gBackSize.Y-gPlayerScreenSize.Y)*sY/(gMapInfo.Height-sHeight));
+
   //r_smallmap_h: 0: left; 1: center; 2: right
   //r_smallmap_v: 0: top; 1: center; 2: bottom
   // horiz small map?