Skip to content

Commit

Permalink
Add Travelled virtual for PlayerPawn, akin to the same function for I…
Browse files Browse the repository at this point in the history
…nventory. (#1169)
  • Loading branch information
Marisa Kirisame committed Sep 2, 2020
1 parent e0aa8db commit 58f5c03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/g_level.cpp
Expand Up @@ -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;
}
Expand Down
12 changes: 12 additions & 0 deletions wadsrc/static/zscript/actors/player/player.zs
Expand Up @@ -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() {}

//----------------------------------------------------------------------------
//
//
Expand Down

0 comments on commit 58f5c03

Please sign in to comment.