DEADSOFTWARE

fix playerstats netmessage; zero gTime before spawning players
[d2df-sdl.git] / src / game / g_game.pas
index 87e4f907deffe20e42522d03beaa16593ae63fd1..3dc360c810087c893adfb3956bc69372b43ddd74 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?
@@ -4948,6 +4948,8 @@ begin
     ResName := Map;
   end;
 
+  gTime := 0;
+
   //writeln('********: gsw=', gGameSettings.WAD, '; rn=', ResName);
   result := false;
   if (ResName <> '') and (NewWAD <> '') then
@@ -4984,7 +4986,6 @@ begin
   gExit := 0;
   gPauseMain := false;
   gPauseHolmes := false;
-  gTime := 0;
   NetTimeToUpdate := 1;
   NetTimeToReliable := 0;
   NetTimeToMaster := NetMasterRate;