mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix crash if save does not exist
This commit is contained in:
parent
129d85fa57
commit
477677775f
|
@ -498,15 +498,15 @@ static std::string LegacyScriptWrite(const TitleSequence& seq)
|
||||||
switch (command.Type)
|
switch (command.Type)
|
||||||
{
|
{
|
||||||
case TitleScript::Load:
|
case TitleScript::Load:
|
||||||
if (command.SaveIndex == 0xFF)
|
if (command.SaveIndex < seq.Saves.size())
|
||||||
{
|
|
||||||
sb.Append("LOAD <No save file>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
sb.Append("LOAD ");
|
sb.Append("LOAD ");
|
||||||
sb.Append(seq.Saves[command.SaveIndex].c_str());
|
sb.Append(seq.Saves[command.SaveIndex].c_str());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.Append("LOAD <No save file>");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TitleScript::LoadSc:
|
case TitleScript::LoadSc:
|
||||||
if (command.Scenario[0] == '\0')
|
if (command.Scenario[0] == '\0')
|
||||||
|
|
Loading…
Reference in New Issue