Add Travelled virtual for PlayerPawn, akin to the same function for Inventory. (#1169)

This commit is contained in:
Marisa Kirisame 2020-09-02 12:12:58 +02:00 committed by drfrag
parent 0255ee7719
commit 0bc5bccb3b
2 changed files with 18 additions and 0 deletions

View file

@ -1475,6 +1475,12 @@ int G_FinishTravel ()
{ {
pawn->Speed = pawn->GetDefault()->Speed; 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. // [ZZ] we probably don't want to fire any scripts before all players are in, especially with runNow = true.
pawns[pawnsnum++] = pawn; pawns[pawnsnum++] = pawn;
} }

View file

@ -2446,6 +2446,18 @@ class PlayerPawn : Actor
return wasdrowning; 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() {}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// //