diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index bc33eb19c..2be2e179d 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -72,7 +72,7 @@ bool APowerupGiver::Use (bool pickup) power->Strength = Strength; } - power->ItemFlags |= ItemFlags & (IF_ALWAYSPICKUP|IF_ADDITIVETIME); + power->ItemFlags |= ItemFlags & (IF_ALWAYSPICKUP|IF_ADDITIVETIME|IF_NOTELEPORTFREEZE); if (power->CallTryPickup (Owner)) { return true; @@ -342,6 +342,18 @@ void APowerup::OwnerDied () Destroy (); } +//=========================================================================== +// +// AInventory :: GetNoTeleportFreeze +// +//=========================================================================== + +bool APowerup::GetNoTeleportFreeze () +{ + if (ItemFlags & IF_NOTELEPORTFREEZE) return true; + return Super::GetNoTeleportFreeze(); +} + // Invulnerability Powerup --------------------------------------------------- IMPLEMENT_CLASS (APowerInvulnerable) diff --git a/src/g_shared/a_artifacts.h b/src/g_shared/a_artifacts.h index 4e1823f5a..c16a7a0c1 100644 --- a/src/g_shared/a_artifacts.h +++ b/src/g_shared/a_artifacts.h @@ -18,6 +18,7 @@ public: virtual AInventory *CreateTossable (); virtual void Serialize (FArchive &arc); virtual void OwnerDied (); + virtual bool GetNoTeleportFreeze(); virtual PalEntry GetBlend (); virtual bool DrawPowerup (int x, int y); diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 038b63029..5d494c935 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -850,6 +850,25 @@ fixed_t AInventory::GetSpeedFactor () } } +//=========================================================================== +// +// AInventory :: GetNoTeleportFreeze +// +//=========================================================================== + +bool AInventory::GetNoTeleportFreeze () +{ + // do not check the flag here because it's only active when used on PowerUps, not on PowerupGivers. + if (Inventory != NULL) + { + return Inventory->GetNoTeleportFreeze(); + } + else + { + return false; + } +} + //=========================================================================== // // AInventory :: AlterWeaponSprite diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 504a26c73..74b10206b 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -137,6 +137,7 @@ enum IF_TOSSED = 1<<22, // Was spawned by P_DropItem (i.e. as a monster drop) IF_ALWAYSRESPAWN = 1<<23, // Always respawn, regardless of dmflag IF_TRANSFER = 1<<24, // All inventory items that the inventory item contains is also transfered to the pickuper + IF_NOTELEPORTFREEZE = 1<<25, // does not 'freeze' the player right after teleporting. }; @@ -201,6 +202,7 @@ public: virtual void AbsorbDamage (int damage, FName damageType, int &newdamage); virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive); virtual fixed_t GetSpeedFactor(); + virtual bool GetNoTeleportFreeze(); virtual int AlterWeaponSprite (visstyle_t *vis); virtual PalEntry GetBlend (); diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index 82359f4e0..040aca9f4 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -211,7 +211,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, if (thing->player && (useFog || !keepOrientation) && bHaltVelocity) { // Freeze player for about .5 sec - if (thing->Inventory == NULL || thing->Inventory->GetSpeedFactor() <= FRACUNIT) + if (thing->Inventory == NULL || !thing->Inventory->GetNoTeleportFreeze()) thing->reactiontime = 18; } if (thing->flags & MF_MISSILE) diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index b1387ba52..817afd0fa 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -331,9 +331,11 @@ static FFlagDef InventoryFlagDefs[] = DEFINE_FLAG(IF, TOSSED, AInventory, ItemFlags), DEFINE_FLAG(IF, ALWAYSRESPAWN, AInventory, ItemFlags), DEFINE_FLAG(IF, TRANSFER, AInventory, ItemFlags), + DEFINE_FLAG(IF, NOTELEPORTFREEZE, AInventory, ItemFlags), DEFINE_DEPRECATED_FLAG(PICKUPFLASH), - DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),}; + DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP), +}; static FFlagDef WeaponFlagDefs[] = { diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 0c106417b..541dd37ac 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -225,6 +225,7 @@ ACTOR PowerWeaponLevel2 : Powerup native { Powerup.Duration -40 Inventory.Icon "SPINBK0" + +INVENTORY.NOTELEPORTFREEZE } ACTOR PowerSpeed : Powerup native @@ -232,6 +233,7 @@ ACTOR PowerSpeed : Powerup native Powerup.Duration -45 Speed 1.5 Inventory.Icon "SPBOOT0" + +INVENTORY.NOTELEPORTFREEZE } // Player Speed Trail (used by the Speed Powerup) ----------------------------