# HG changeset patch # User unc0rr # Date 1317845515 -14400 # Node ID 47d1b04003d110838f079c8fa41388942bbb9127 # Parent 6e422ea250a1c48f370414b2af312a477fa7b68b - Frontend: don't pass /script for missions - Engine: try to load script for map (not tested) diff -r 6e422ea250a1 -r 47d1b04003d1 QTfrontend/ui/widget/gamecfgwidget.cpp --- a/QTfrontend/ui/widget/gamecfgwidget.cpp Wed Oct 05 22:57:42 2011 +0400 +++ b/QTfrontend/ui/widget/gamecfgwidget.cpp Thu Oct 06 00:11:55 2011 +0400 @@ -233,8 +233,10 @@ if (currentMap.size() > 0) { bcfg << QString("emap " + currentMap).toUtf8(); - if(pMapContainer->getCurrentIsMission()) - bcfg << QString("escript Maps/%1/map.lua").arg(currentMap).toUtf8(); + +// engine should figure it out on its own +// if(pMapContainer->getCurrentIsMission()) +// bcfg << QString("escript Maps/%1/map.lua").arg(currentMap).toUtf8(); } bcfg << QString("etheme " + pMapContainer->getCurrentTheme()).toUtf8(); diff -r 6e422ea250a1 -r 47d1b04003d1 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Wed Oct 05 22:57:42 2011 +0400 +++ b/hedgewars/uCommandHandlers.pas Thu Oct 06 00:11:55 2011 +0400 @@ -451,11 +451,13 @@ procedure chSetMap(var s: shortstring); begin if isDeveloperMode then -begin -UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; -Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; -InitStepsFlags:= InitStepsFlags or cifMap -end + begin + UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; + Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; + InitStepsFlags:= InitStepsFlags or cifMap + end; + +ScriptLoad(s) end; procedure chSetTheme(var s: shortstring); diff -r 6e422ea250a1 -r 47d1b04003d1 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Wed Oct 05 22:57:42 2011 +0400 +++ b/hedgewars/uScript.pas Thu Oct 06 00:11:55 2011 +0400 @@ -1673,6 +1673,8 @@ begin s:= UserPathz[ptData] + '/' + name; if not FileExists(s) then s:= Pathz[ptData] + '/' + name; +if not FileExists(s) then exit; + ret:= luaL_loadfile(luaState, Str2PChar(s)); if ret <> 0 then begin