diff --git a/src/g_level.cpp b/src/g_level.cpp index 7bcdfaf53..93cf155c9 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1475,6 +1475,12 @@ int G_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 7e0fb358b..18b2efa8f 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -2446,6 +2446,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() {} + //---------------------------------------------------------------------------- // //