parent
1eee06d9f9
commit
d357de1438
|
@ -3689,7 +3689,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
||||||
// TODO: m_engine->TimeInit(); ??
|
// TODO: m_engine->TimeInit(); ??
|
||||||
m_input->ResetKeyStates();
|
m_input->ResetKeyStates();
|
||||||
m_time = 0.0f;
|
m_time = 0.0f;
|
||||||
m_gameTime = 0.0f;
|
if (m_sceneReadPath.empty()) m_gameTime = 0.0f;
|
||||||
m_gameTimeAbsolute = 0.0f;
|
m_gameTimeAbsolute = 0.0f;
|
||||||
m_autosaveLast = 0.0f;
|
m_autosaveLast = 0.0f;
|
||||||
m_infoUsed = 0;
|
m_infoUsed = 0;
|
||||||
|
@ -4542,6 +4542,7 @@ bool CRobotMain::IOWriteScene(std::string filename, std::string filecbot, std::s
|
||||||
else
|
else
|
||||||
line->AddParam("chap", MakeUnique<CLevelParserParam>(m_levelChap));
|
line->AddParam("chap", MakeUnique<CLevelParserParam>(m_levelChap));
|
||||||
line->AddParam("rank", MakeUnique<CLevelParserParam>(m_levelRank));
|
line->AddParam("rank", MakeUnique<CLevelParserParam>(m_levelRank));
|
||||||
|
line->AddParam("gametime", MakeUnique<CLevelParserParam>(GetGameTime()));
|
||||||
levelParser.AddLine(std::move(line));
|
levelParser.AddLine(std::move(line));
|
||||||
|
|
||||||
line = MakeUnique<CLevelParserLine>("Map");
|
line = MakeUnique<CLevelParserLine>("Map");
|
||||||
|
@ -4722,6 +4723,9 @@ CObject* CRobotMain::IOReadScene(std::string filename, std::string filecbot)
|
||||||
int objCounter = 0;
|
int objCounter = 0;
|
||||||
for (auto& line : levelParser.GetLines())
|
for (auto& line : levelParser.GetLines())
|
||||||
{
|
{
|
||||||
|
if (line->GetCommand() == "Mission")
|
||||||
|
m_gameTime = line->GetParam("gametime")->AsFloat(0.0f);
|
||||||
|
|
||||||
if (line->GetCommand() == "Map")
|
if (line->GetCommand() == "Map")
|
||||||
m_map->ZoomMap(line->GetParam("zoom")->AsFloat());
|
m_map->ZoomMap(line->GetParam("zoom")->AsFloat());
|
||||||
|
|
||||||
|
|
|
@ -1010,6 +1010,8 @@ void COldObject::Write(CLevelParserLine* line)
|
||||||
if ( m_virusTime != 0.0f )
|
if ( m_virusTime != 0.0f )
|
||||||
line->AddParam("virusTime", MakeUnique<CLevelParserParam>(m_virusTime));
|
line->AddParam("virusTime", MakeUnique<CLevelParserParam>(m_virusTime));
|
||||||
|
|
||||||
|
line->AddParam("lifetime", MakeUnique<CLevelParserParam>(m_aTime));
|
||||||
|
|
||||||
// Sets the parameters of the command line.
|
// Sets the parameters of the command line.
|
||||||
CLevelParserParamVec cmdline;
|
CLevelParserParamVec cmdline;
|
||||||
for(float value : GetCmdLine())
|
for(float value : GetCmdLine())
|
||||||
|
@ -1144,6 +1146,8 @@ void COldObject::Read(CLevelParserLine* line)
|
||||||
m_bVirusMode = line->GetParam("virusMode")->AsBool(false);
|
m_bVirusMode = line->GetParam("virusMode")->AsBool(false);
|
||||||
m_virusTime = line->GetParam("virusTime")->AsFloat(0.0f);
|
m_virusTime = line->GetParam("virusTime")->AsFloat(0.0f);
|
||||||
|
|
||||||
|
m_aTime = line->GetParam("lifetime")->AsFloat(0.0f);
|
||||||
|
|
||||||
if ( m_motion != nullptr )
|
if ( m_motion != nullptr )
|
||||||
{
|
{
|
||||||
m_motion->Read(line);
|
m_motion->Read(line);
|
||||||
|
|
Loading…
Reference in New Issue