Permalink
Browse files

more work

  • Loading branch information...
coelckers committed Jan 11, 2019
1 parent b94a593 commit 67326e05c4f2aac419269af4f2107beff31b89fa
@@ -170,7 +170,7 @@ CUSTOM_CVAR (Int, fraglimit, 0, CVAR_SERVERINFO)
if (playeringame[i] && self <= D_GetFragCount(&players[i]))
{
Printf ("%s\n", GStrings("TXT_FRAGLIMIT"));
G_ExitLevel (0, false);
G_ExitLevel (currentSession->Levelinfo[0], 0, false);
break;
}
}
@@ -2228,8 +2228,9 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
// That was a long time ago. Maybe it works now?
if (currentSession)
{
currentSession->Levelinfo[0]->flags |= LEVEL_CHANGEMAPCHEAT;
G_ChangeLevel(s, pos, 0);
auto Level = currentSession->Levelinfo[0];
Level->flags |= LEVEL_CHANGEMAPCHEAT;
G_ChangeLevel(Level, s, pos, 0);
}
break;

@@ -2667,7 +2668,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player)

case DEM_FINISHGAME:
// Simulate an end-of-game action
G_ChangeLevel(NULL, 0, 0);
if (currentSession)
{
auto Level = currentSession->Levelinfo[0];
G_ChangeLevel(Level, nullptr, 0, 0);
}
break;

case DEM_NETEVENT:
@@ -229,7 +229,7 @@ void DThinker::SerializeThinkers(FSerializer &arc, bool hubLoad)
void DThinker::Serialize(FSerializer &arc)
{
Super::Serialize(arc);
Level = &level; // Must be written out once a real object.
Level = arc.Level;
}

//==========================================================================
@@ -242,7 +242,7 @@ DThinker::DThinker (int statnum) throw()
{
NextThinker = NULL;
PrevThinker = NULL;
Level = &level; // do this properly later.
Level = currentSession->Levelinfo[0]; // do this properly later.
if (bSerialOverride)
{ // The serializer will insert us into the right list
return;
@@ -77,7 +77,7 @@ static void FS_Gimme(const char * what)
//
//==========================================================================

void FS_MapCmd(FScanner &sc)
void FS_MapCmd(FLevelLocals *Level, FScanner &sc)
{
char nextmap[9];
int NextSkill = -1;
@@ -108,7 +108,7 @@ void FS_MapCmd(FScanner &sc)
flags &= ~(CHANGELEVEL_RESETINVENTORY|CHANGELEVEL_RESETHEALTH);
}
}
G_ChangeLevel(nextmap, 0, flags, NextSkill);
G_ChangeLevel(Level, nextmap, 0, flags, NextSkill);
}

//==========================================================================
@@ -168,7 +168,7 @@ void FS_EmulateCmd(FLevelLocals *Level, char * string)
}
else if (sc.Compare("map"))
{
FS_MapCmd(sc);
FS_MapCmd(Level, sc);
}
else if (sc.Compare("gr_fogdensity"))
{
@@ -635,7 +635,7 @@ void FParser::SF_Clock(void)

void FParser::SF_ExitLevel(void)
{
G_ExitLevel(0, false);
G_ExitLevel(Level, 0, false);
}

//==========================================================================
@@ -2853,7 +2853,7 @@ void FParser::SF_AmbientSound(void)

void FParser::SF_ExitSecret(void)
{
G_SecretExitLevel(0);
G_SecretExitLevel(Level, 0);
}


@@ -179,7 +179,7 @@ void DFsScript::Serialize(FSerializer &arc)
// don't save a reference to the global script, which contains unserializable data.
if (parent == Level->FraggleScriptThinker->GlobalScript) parent = nullptr;

if (arc.isReading()) Level = &level; // must later be written out.
if (arc.isReading()) Level = arc.Level;

arc("data", data)
("scriptnum", scriptnum)
@@ -1924,7 +1924,7 @@ void G_DoLoadGame ()
NextSkill = -1;
arc("nextskill", NextSkill);

currentSession->Snapshots.Remove(level.MapName);
//currentSession->Snapshots.Remove(MapName); fixme

BackupSaveName = savename;

@@ -2135,7 +2135,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
{
// delete the snapshot. Since the save failed it is broken.
insave = false;
level.info->Snapshot.Clean();
//level.info->Snapshot.Clean();
Printf(PRINT_HIGH, "Save failed\n");
Printf(PRINT_HIGH, "%s\n", err.GetMessage());
// The time freeze must be reset if the save fails.
@@ -2233,8 +2233,8 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio

// delete the JSON buffers we created just above. Everything else will
// either still be needed or taken care of automatically.
savegame_content[1].Clean();
savegame_content[2].Clean();
//savegame_content[1].Clean();
//savegame_content[2].Clean();

// Check whether the file is ok by trying to open it.
FResourceFile *test = FResourceFile::OpenResourceFile(filename, true);
@@ -2250,7 +2250,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
BackupSaveName = filename;

// We don't need the snapshot any longer.
level.info->Snapshot.Clean();
//currentSession->Snapshots.Remove(???);

insave = false;

Oops, something went wrong.

0 comments on commit 67326e0

Please sign in to comment.