# HG changeset patch # User nemo # Date 1321152266 18000 # Node ID 2a392517817853cc129fd2b91c60034faf1b68be # Parent 84e7d1a5e3dfd724857b3ec908e44eed9ef230d5 this should allow overriding static maps from lua diff -r 84e7d1a5e3df -r 2a3925178178 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sat Nov 12 21:59:10 2011 +0100 +++ b/hedgewars/uCommandHandlers.pas Sat Nov 12 21:44:26 2011 -0500 @@ -453,8 +453,16 @@ begin if isDeveloperMode then begin - UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; - Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; + if s = '' then + begin + UserPathz[ptMapCurrent]:= s; + Pathz[ptMapCurrent]:= s; + end + else + begin + UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; + Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; + end; InitStepsFlags:= InitStepsFlags or cifMap end; diff -r 84e7d1a5e3df -r 2a3925178178 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Sat Nov 12 21:59:10 2011 +0100 +++ b/hedgewars/uScript.pas Sat Nov 12 21:44:26 2011 -0500 @@ -1642,8 +1642,7 @@ cWaterRise := ScriptGetInteger('WaterRise'); cHealthDecrease := ScriptGetInteger('HealthDecrease'); -if ScriptGetString('Map') <> '' then - ParseCommand('map ' + ScriptGetString('Map'), true); +ParseCommand('map ' + ScriptGetString('Map'), true); if ScriptGetString('Theme') <> '' then ParseCommand('theme ' + ScriptGetString('Theme'), true); LuaGoals:= ScriptGetString('Goals');