From 4cb3ce819699a790b51073b8e0f711011944cf66 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 29 Jan 2019 16:11:23 +0100 Subject: [PATCH] - StartTravel and EndTravel --- src/g_level.cpp | 14 +++++++------- src/g_level.h | 3 --- src/g_levellocals.h | 2 ++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 6f8c23216..8bc9ab97d 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1279,7 +1279,7 @@ void G_DoWorldDone (void) Printf ("No next map specified.\n"); nextlevel = level.MapName; } - G_StartTravel (); + level.StartTravel (); G_DoLoadLevel (nextlevel, startpos, true, false); startpos = 0; gameaction = ga_nothing; @@ -1296,7 +1296,7 @@ void G_DoWorldDone (void) // //========================================================================== -void G_StartTravel () +void FLevelLocals::StartTravel () { if (deathmatch) return; @@ -1343,9 +1343,9 @@ void G_StartTravel () // //========================================================================== -int G_FinishTravel () +int FLevelLocals::FinishTravel () { - TThinkerIterator it (NAME_PlayerPawn, STAT_TRAVELLING); + auto it = GetThinkerIterator(NAME_PlayerPawn, STAT_TRAVELLING); AActor *pawn, *pawndup, *oldpawn, *next; AActor *inv; FPlayerStart *start; @@ -1365,7 +1365,7 @@ int G_FinishTravel () pawndup = pawn->player->mo; assert (pawn != pawndup); - start = level.PickPlayerStart(pnum, 0); + start = PickPlayerStart(pnum, 0); if (start == NULL) { if (pawndup != nullptr) @@ -1384,7 +1384,7 @@ int G_FinishTravel () // The player being spawned here is a short lived dummy and // must not start any ENTER script or big problems will happen. - pawndup = level.SpawnPlayer(start, pnum, SPF_TEMPPLAYER); + pawndup = SpawnPlayer(start, pnum, SPF_TEMPPLAYER); if (pawndup != NULL) { if (!(changeflags & CHANGELEVEL_KEEPFACING)) @@ -1736,7 +1736,7 @@ void FLevelLocals::UnSnapshotLevel (bool hubLoad) if (hubLoad) { // Unlock ACS global strings that were locked when the snapshot was made. - Behaviors.UnlockLevelVarStrings(level.levelnum); + Behaviors.UnlockLevelVarStrings(levelnum); } } diff --git a/src/g_level.h b/src/g_level.h index e8d694dd4..bdba32b7b 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -472,9 +472,6 @@ enum void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill=-1); -void G_StartTravel (); -int G_FinishTravel (); - void G_DoLoadLevel (const FString &MapName, int position, bool autosave, bool newGame); cluster_info_t *FindClusterInfo (int cluster); diff --git a/src/g_levellocals.h b/src/g_levellocals.h index 752b5aced..758370db5 100644 --- a/src/g_levellocals.h +++ b/src/g_levellocals.h @@ -220,6 +220,8 @@ public: void DeathMatchSpawnPlayer (int playernum); FPlayerStart *PickPlayerStart(int playernum, int flags = 0); bool DoCompleted(FString nextlevel, wbstartstruct_t &wminfo); + void StartTravel(); + int FinishTravel(); private: