Fix difference in map generation between fpc and pas2c engine
authorunc0rr
Sat, 15 Nov 2014 22:19:38 +0300
changeset 10502 a888e649bea2
parent 10501 89e8d6d05dfa
child 10503 b72e3dc97418
Fix difference in map generation between fpc and pas2c engine
hedgewars/uLandGenTemplateBased.pas
hedgewars/uUtils.pas
--- a/hedgewars/uLandGenTemplateBased.pas	Sat Nov 15 09:43:21 2014 -0500
+++ b/hedgewars/uLandGenTemplateBased.pas	Sat Nov 15 22:19:38 2014 +0300
@@ -149,7 +149,7 @@
         if t1 > 0 then distL:= d else distR:= d;
 
         // right border
-        iy:= (rightX - mapBorderMargin - mp.x) * b div a + mp.y;
+        iy:= (LongInt(rightX) - mapBorderMargin - mp.x) * b div a + mp.y;
         d:= DistanceI(mp.x - rightX + mapBorderMargin, mp.y - iy).Round;
         if t1 > 0 then distR:= d else distL:= d;
     end else
--- a/hedgewars/uUtils.pas	Sat Nov 15 09:43:21 2014 -0500
+++ b/hedgewars/uUtils.pas	Sat Nov 15 22:19:38 2014 +0300
@@ -516,7 +516,11 @@
             logfileBase:= 'game';
     end
     else
+        {$IFDEF PAS2C}
         logfileBase:= 'preview';
+        {$ELSE}
+        logfileBase:= 'preview_pas2c';
+        {$ENDIF}
 {$IFDEF USE_VIDEO_RECORDING}
     InitCriticalSection(logMutex);
 {$ENDIF}