Move sidecar lua load to prior to script load. This should let the script use it for dependencies.
--- a/hedgewars/uScript.pas Mon Apr 24 13:53:34 2017 +0200
+++ b/hedgewars/uScript.pas Mon Apr 24 09:59:10 2017 -0400
@@ -2979,6 +2979,8 @@
if f = nil then
exit;
+hedgewarsMountPackage(Str2PChar(copy(s, 1, length(s)-4)+'.hwp'));
+
physfsReaderSetBuffer(@buf);
ret:= lua_load(luaState, @physfsReader, f, Str2PChar(s));
pfsClose(f);
@@ -2995,7 +2997,6 @@
lua_pcall(luaState, 0, 0, 0);
ScriptLoaded:= true
end;
-hedgewarsMountPackage(Str2PChar(copy(s, 1, length(s)-4)+'.hwp'));
end;
procedure SetGlobals;