diff --git a/src/g_level.cpp b/src/g_level.cpp index 6500c83935c..ee82e8c583d 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1564,6 +1564,12 @@ int FLevelLocals::FinishTravel () { pawn->Speed = pawn->GetDefault()->Speed; } + + IFVIRTUALPTRNAME(pawn, NAME_PlayerPawn, Travelled) + { + VMValue params[1] = { pawn }; + VMCall(func, params, 1, nullptr, 0); + } // [ZZ] we probably don't want to fire any scripts before all players are in, especially with runNow = true. pawns[pawnsnum++] = pawn; } diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index 0f2db79222c..150a7a4f8e5 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -2432,6 +2432,18 @@ class PlayerPawn : Actor return wasdrowning; } + //=========================================================================== + // + // PlayerPawn :: Travelled + // + // Called when the player moves to another map, in case it needs to do + // special reinitialization. This is called after all carried items have + // executed their respective Travelled() virtuals too. + // + //=========================================================================== + + virtual void Travelled() {} + //---------------------------------------------------------------------------- // //