mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-20 19:12:07 +00:00
PreTravelled virtual for player and inventory.
This commit is contained in:
parent
bc75dc056e
commit
d5ad8b28ec
2 changed files with 32 additions and 0 deletions
|
@ -853,6 +853,17 @@ class Inventory : Actor
|
|||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Inventory :: PreTravelled
|
||||
//
|
||||
// Called when an item in somebody's inventory is about to be carried
|
||||
// over to another map, in case it needs to do special clean-up.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
virtual void PreTravelled() {}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Inventory :: Travelled
|
||||
|
|
|
@ -2083,6 +2083,15 @@ class PlayerPawn : Actor
|
|||
me.ClearInventory();
|
||||
me.GiveDefaultInventory();
|
||||
}
|
||||
|
||||
// [MK] notify self and inventory that we're about to travel
|
||||
// this must be called here so these functions can still have a
|
||||
// chance to alter the world before a snapshot is done in hubs
|
||||
me.PreTravelled();
|
||||
for (item = me.Inv; item != NULL; item = item.Inv)
|
||||
{
|
||||
item.PreTravelled();
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -2461,6 +2470,18 @@ class PlayerPawn : Actor
|
|||
return wasdrowning;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// PlayerPawn :: PreTravelled
|
||||
//
|
||||
// Called before the player moves to another map, in case it needs to do
|
||||
// special clean-up. This is called right before all carried items
|
||||
// execute their respective PreTravelled() virtuals.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
virtual void PreTravelled() {}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// PlayerPawn :: Travelled
|
||||
|
|
Loading…
Reference in a new issue