forked from Mirrors/openclonk
Fix scenario saving as network client to not delete saved scenario after game end (#1814)
parent
f796716655
commit
b763982f45
|
@ -73,6 +73,7 @@ IDS_CNS_NOCHILDSAVE=%s befindet sich in einem Rundenordner. Szenarien können ni
|
|||
IDS_CNS_NOFULLSCREENPLRS=Im Vollbildmodus kann nur gestartet werden, wenn Spieler am Spiel teilnehmen.
|
||||
IDS_CNS_NOMATDEF=Zeichnen nicht möglich, da die angegebene Material-Textur-Kombination '%s-%s' nicht in der geladenen Texturtabelle definiert ist.
|
||||
IDS_CNS_NONETEDIT=Bei Wiedergabe einer Aufnahme kann nicht editiert werden.
|
||||
IDS_CNS_NONETREFSAVE=Kann nicht ueber temporaere Netzwerkreferenz speichern. Bitte 'Speichern unter...' benutzen.
|
||||
IDS_CNS_NOOBJECT=Kein Objekt ausgewählt.
|
||||
IDS_CNS_NOTHING=Nichts
|
||||
IDS_CNS_OBJECT=Objekt
|
||||
|
|
|
@ -73,6 +73,7 @@ IDS_CNS_NOCHILDSAVE=%s is located in a group folder. Scenarios cannot be saved i
|
|||
IDS_CNS_NOFULLSCREENPLRS=Fullscreen mode requires at least one participating player.
|
||||
IDS_CNS_NOMATDEF=Cannot draw because selected material-texture combination '%s-%s' is not defined in the texture table.
|
||||
IDS_CNS_NONETEDIT=No editing while replaying.
|
||||
IDS_CNS_NONETREFSAVE=Cannot save over temporary network reference file. Please use 'Save as...' to save to a new filename.
|
||||
IDS_CNS_NOOBJECT=No selected objects.
|
||||
IDS_CNS_NOTHING=Nothing
|
||||
IDS_CNS_OBJECT=Object
|
||||
|
|
|
@ -164,11 +164,20 @@ bool C4Console::SaveScenario(const char * path)
|
|||
Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"),path).getData());
|
||||
return false;
|
||||
}
|
||||
SCopy(path, Game.ScenarioFilename);
|
||||
SCopy(path, Game.ScenarioFilename, MAX_PATH);
|
||||
SetCaptionToFilename(Game.ScenarioFilename);
|
||||
if (!Game.ScenarioFile.Open(Game.ScenarioFilename))
|
||||
{
|
||||
Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"),Game.ScenarioFilename).getData());
|
||||
Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"), Game.ScenarioFilename).getData());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do not save to temp network file
|
||||
if (Game.TempScenarioFile && ItemIdentical(Game.TempScenarioFile.getData(), Game.ScenarioFilename))
|
||||
{
|
||||
Message(LoadResStr("IDS_CNS_NONETREFSAVE"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,9 +264,6 @@ bool C4Game::OpenScenario()
|
|||
|
||||
void C4Game::CloseScenario()
|
||||
{
|
||||
// safe scenario file name
|
||||
char szSzenarioFile[_MAX_PATH + 1];
|
||||
SCopy(ScenarioFile.GetFullName().getData(), szSzenarioFile, _MAX_PATH);
|
||||
// close scenario
|
||||
ScenarioFile.Close();
|
||||
GroupSet.CloseFolders();
|
||||
|
@ -274,8 +271,8 @@ void C4Game::CloseScenario()
|
|||
// remove if temporary
|
||||
if (TempScenarioFile)
|
||||
{
|
||||
EraseItem(szSzenarioFile);
|
||||
TempScenarioFile = false;
|
||||
EraseItem(TempScenarioFile.getData());
|
||||
TempScenarioFile.Clear();
|
||||
}
|
||||
// clear scenario section
|
||||
// this removes any temp files, which may yet need to be used by any future features
|
||||
|
@ -414,7 +411,7 @@ bool C4Game::Init()
|
|||
// open new scenario
|
||||
SCopy(szScenario, ScenarioFilename, _MAX_PATH);
|
||||
if (!OpenScenario()) return false;
|
||||
TempScenarioFile = true;
|
||||
TempScenarioFile.Copy(ScenarioFilename);
|
||||
|
||||
// get everything else
|
||||
if (!Parameters.GameRes.RetrieveFiles()) return false;
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
bool Record;
|
||||
StdStrBuf RecordDumpFile;
|
||||
StdStrBuf RecordStream;
|
||||
bool TempScenarioFile;
|
||||
StdStrBuf TempScenarioFile;
|
||||
bool fPreinited; // set after PreInit has been called; unset by Clear and Default
|
||||
int32_t FrameCounter;
|
||||
int32_t iTick2,iTick3,iTick5,iTick10,iTick35,iTick255,iTick1000;
|
||||
|
|
Loading…
Reference in New Issue