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 GitHub
parent e0aa8db616
commit 58f5c030fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -1564,6 +1564,12 @@ int FLevelLocals::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

@ -2432,6 +2432,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() {}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// //