At mikade's request. give scripting access to the map name prior to override.
--- a/hedgewars/uCommandHandlers.pas Mon Mar 26 23:54:12 2012 +0400
+++ b/hedgewars/uCommandHandlers.pas Mon Mar 26 20:29:37 2012 -0400
@@ -523,7 +523,7 @@
end;
InitStepsFlags:= InitStepsFlags or cifMap
end;
-
+cMapName:= s;
ScriptLoad('Maps/' + s + '/map.lua')
end;
--- a/hedgewars/uScript.pas Mon Mar 26 23:54:12 2012 +0400
+++ b/hedgewars/uScript.pas Mon Mar 26 20:29:37 2012 -0400
@@ -1735,7 +1735,8 @@
ScriptSetInteger('SuddenDeathTurns', cSuddenDTurns);
ScriptSetInteger('WaterRise', cWaterRise);
ScriptSetInteger('HealthDecrease', cHealthDecrease);
-ScriptSetString('Map', 'CHANGE_ME');
+ScriptSetString('Map', cMapName);
+
ScriptSetString('Theme', '');
ScriptSetString('Goals', '');
@@ -1762,8 +1763,7 @@
cWaterRise := ScriptGetInteger('WaterRise');
cHealthDecrease := ScriptGetInteger('HealthDecrease');
-if ScriptGetString('Map') <> 'CHANGE_ME' then
- ParseCommand('map ' + ScriptGetString('Map'), true);
+ParseCommand('map ' + ScriptGetString('Map'), true);
if ScriptGetString('Theme') <> '' then
ParseCommand('theme ' + ScriptGetString('Theme'), true);
LuaGoals:= ScriptGetString('Goals');
--- a/hedgewars/uVariables.pas Mon Mar 26 23:54:12 2012 +0400
+++ b/hedgewars/uVariables.pas Mon Mar 26 20:29:37 2012 -0400
@@ -57,6 +57,7 @@
cStereoMode : TStereoMode = smNone;
cOnlyStats : boolean = False;
//////////////////////////
+ cMapName : shortstring = '';
alsoShutdownFrontend: boolean = false;