Merge pull request #1151 from melex750/dev-savegame

Fix saving/loading "NewScript" programs for factory bots
1008-fix
krzys_h 2018-05-07 20:42:51 +02:00 committed by GitHub
commit b36d40a509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -3667,7 +3667,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;
}