Fix save/load NewScript programs for factory bots

Fixes #797
1008-fix
melex750 2018-04-30 13:43:03 -04:00
parent fdf67b8217
commit a918fcabb4
2 changed files with 2 additions and 2 deletions

View File

@ -3633,7 +3633,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (line->GetCommand() == "NewScript" && !resetObject)
{
m_newScriptName.push_back(NewScriptName(line->GetParam("type")->AsObjectType(OBJECT_NULL), const_cast<char*>(line->GetParam("name")->AsPath("ai").c_str())));
m_newScriptName.push_back(NewScriptName(line->GetParam("type")->AsObjectType(OBJECT_NULL), line->GetParam("name")->AsString("")));
continue;
}

View File

@ -667,7 +667,7 @@ bool CAutoFactory::CreateVehicle()
for (const std::string& name : m_main->GetNewScriptNames(m_type))
{
Program* prog = programStorage->AddProgram();
programStorage->ReadProgram(prog, InjectLevelPathsForCurrentLevel(name));
programStorage->ReadProgram(prog, InjectLevelPathsForCurrentLevel(name, "ai"));
prog->readOnly = true;
prog->filename = name;
}