diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 4e33cad10f28e10a42aeb2709acff3725a37abbd..fcb43f319d324f9cf568c3d6abd04837aabd3ebe 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
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;
p.viewPortX := sX;
p.viewPortY := sY;