From: fgsfds <pvt.fgsfds@gmail.com>
Date: Sun, 9 Feb 2020 02:42:48 +0000 (+0300)
Subject: always calculate c and d in camera stuff
X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=08e3dd168587e3c1f65cc9b2b93d917c7617c0ce;p=d2df-sdl.git

always calculate c and d in camera stuff
---

diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 87e4f90..854a15a 100644
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
@@ -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?