- eliminated the native PowerupGiver class.

- scriptified the respawn invulnerability code into a virtual OnRespawn function for PlayerPawn so that custom effects can be implemented.
This commit is contained in:
Christoph Oelckers 2017-01-18 00:11:04 +01:00
commit 232b64d332
17 changed files with 139 additions and 131 deletions

View file

@ -1263,10 +1263,11 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode, int flags)
// Strip all current powers, unless moving in a hub and the power is okay to keep.
item = p->mo->Inventory;
auto ptype = PClass::FindActor(NAME_Powerup);
while (item != NULL)
{
next = item->Inventory;
if (item->IsKindOf (RUNTIME_CLASS(APowerup)))
if (item->IsKindOf (ptype))
{
if (deathmatch || ((mode != FINISH_SameHub || !(item->ItemFlags & IF_HUBPOWER))
&& !(item->ItemFlags & IF_PERSISTENTPOWER))) // Keep persistent powers in non-deathmatch games