LAND_HEIGHT/LAND_WIDTH need setting later now
authornemo
Sun, 02 Sep 2012 10:11:24 -0400
changeset 7650 ffa26ebdf8ae
parent 7649 df90970ae81a
child 7651 4cd85eebc54b
LAND_HEIGHT/LAND_WIDTH need setting later now
hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Sun Sep 02 09:23:36 2012 -0400
+++ b/hedgewars/uScript.pas	Sun Sep 02 10:11:24 2012 -0400
@@ -1950,9 +1950,14 @@
 ScriptSetInteger('RealTime', RealTicks);
 ScriptSetInteger('TotalRounds', TotalRounds);
 ScriptSetInteger('WaterLine', cWaterLine);
-ScriptSetInteger('LeftX', leftX);
-ScriptSetInteger('RightX', rightX);
-ScriptSetInteger('TopY', topY);
+if GameTicks = 0 then
+    begin
+    ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
+    ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
+    ScriptSetInteger('LeftX', leftX);
+    ScriptSetInteger('RightX', rightX);
+    ScriptSetInteger('TopY', topY)
+    end;
 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
     ScriptSetInteger('CurrentHedgehog', CurrentHedgehog^.Gear^.UID)
 else
@@ -2149,8 +2154,6 @@
 luaopen_table(luaState);
 
 // import some variables
-ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
-ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
 ScriptSetString(_S'L', cLocale);
 
 // import game flags