Script: ScriptFile may now be a relative path (e.g. ScriptFile=File.lua is now valid and equal to ScriptFile=#CURRENTPATH#File.lua)

This commit is contained in:
Birunthan Mohanathas 2011-07-09 16:42:51 +00:00
parent f0fbc0f145
commit 349ad952ad
2 changed files with 7 additions and 4 deletions

View File

@ -142,10 +142,13 @@ void CMeasureScript::ReadConfig(CConfigParser& parser, const WCHAR* section)
// Read common configs
CMeasure::ReadConfig(parser, section);
m_ScriptFile = ConvertToAscii(parser.ReadString(section, L"ScriptFile", L"").c_str());
std::wstring file = parser.ReadString(section, L"ScriptFile", L"");
if (!m_ScriptFile.empty())
if (!file.empty())
{
file = m_MeterWindow->MakePathAbsolute(file);
m_ScriptFile = ConvertToAscii(file.c_str());
if (!m_Initialized ||
oldScriptFile != m_ScriptFile)
{

View File

@ -98,7 +98,7 @@ bool LuaScript::IsFunction(const char* funcName)
{
bool bExists = false;
if (m_Initialized && funcName)
if (m_Initialized)
{
// Push our table onto the stack
PushTable();
@ -244,4 +244,4 @@ void LuaScript::RunString(const char* str)
//
// //lua_pop(m_pLuaScript->GetState(), 1);
//}
//
//