diff --git a/docs/rh-log.txt b/docs/rh-log.txt index d362dc281..85a771a54 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,11 @@ June 14, 2008 +- Increased the duration of respawn invulnerability by one second. +- DF2_YES_RESPAWN_INVUL and DF_FORCE_RESPAWN now apply to all multiplayer + games, not just deathmatch, without the need for turning on + alwaysapplydmflags. +- Fixed: DF2_YES_RESPAWN_INVUL only worked in deathmatch, even with + alwaysapplydmflags turned on. +- Fixed: DF_COOP_LOSE_ARMOR did not empty the starting armor items. - Replaced the naive area sound implementation with one that takes into consideration the size and shape of the sector producing the sound. See the lifts on Doom 2 MAP30 and compare with previous versions. diff --git a/src/g_game.cpp b/src/g_game.cpp index a5d8179f4..7a6d206f3 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1222,15 +1222,6 @@ void G_PlayerReborn (int player) bglobal.CleanBotstuff (p); else p->isbot = false; - - // [BC] Handle temporary invulnerability when respawned - if ((dmflags2 & DF2_YES_RESPAWN_INVUL) && (deathmatch || alwaysapplydmflags)) - { - APowerup *invul = static_cast(actor->GiveInventoryType (RUNTIME_CLASS(APowerInvulnerable))); - invul->EffectTics = 2*TICRATE; - invul->BlendColor = 0; // don't mess with the view - actor->effects |= FX_RESPAWNINVUL; // [RH] special effect - } } // diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 8037971d4..d7f8bf652 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -98,7 +98,7 @@ enum IF_KEEPDEPLETED = 1<<13, // Items with this flag are retained even when they run out. IF_IGNORESKILL = 1<<14, // Ignores any skill related multiplicators when giving this item. IF_CREATECOPYMOVED = 1<<15, // CreateCopy changed the owner (copy's Owner field holds new owner). - IF_INITEFFECTFAILED = 1<<16 // CreateCopy tried to activate a powerup and activation failed (can happen with PowerMorph) + IF_INITEFFECTFAILED = 1<<16, // CreateCopy tried to activate a powerup and activation failed (can happen with PowerMorph) }; struct vissprite_t; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 311474258..d786fb24b 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3682,6 +3682,16 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) // it above, but the other modes don't. oldactor->DestroyAllInventory(); } + // [BC] Handle temporary invulnerability when respawned + if ((state == PST_REBORN || state == PST_ENTER) && + (dmflags2 & DF2_YES_RESPAWN_INVUL) && + (multiplayer || alwaysapplydmflags)) + { + APowerup *invul = static_cast(p->mo->GiveInventoryType (RUNTIME_CLASS(APowerInvulnerable))); + invul->EffectTics = 3*TICRATE; + invul->BlendColor = 0; // don't mess with the view + p->mo->effects |= FX_RESPAWNINVUL; // [RH] special effect + } if (StatusBar != NULL && (playernum == consoleplayer || StatusBar->GetPlayer() == playernum)) { diff --git a/src/p_user.cpp b/src/p_user.cpp index 89e3dbbaa..b2467bfcf 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -748,8 +748,6 @@ void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer) return; } - // If we don't want to lose anything, then we don't need to bother checking - // the old inventory. if (dmflags & (DF_COOP_LOSE_KEYS | DF_COOP_LOSE_WEAPONS | DF_COOP_LOSE_AMMO | @@ -781,10 +779,24 @@ void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer) item->Destroy(); } else if ((dmflags & DF_COOP_LOSE_ARMOR) && - defitem == NULL && item->IsKindOf(RUNTIME_CLASS(AArmor))) { - item->Destroy(); + if (defitem != NULL) + { + item->Destroy(); + } + else if (item->IsKindOf(RUNTIME_CLASS(ABasicArmor))) + { + static_cast(item)->SavePercent = static_cast(defitem)->SavePercent; + item->Amount = defitem->Amount; + } + else if (item->IsKindOf(RUNTIME_CLASS(AHexenArmor))) + { + static_cast(item)->Slots[0] = static_cast(defitem)->Slots[0]; + static_cast(item)->Slots[1] = static_cast(defitem)->Slots[1]; + static_cast(item)->Slots[2] = static_cast(defitem)->Slots[2]; + static_cast(item)->Slots[3] = static_cast(defitem)->Slots[3]; + } } else if ((dmflags & DF_COOP_LOSE_POWERUPS) && defitem == NULL && @@ -1853,7 +1865,7 @@ void P_DeathThink (player_t *player) } if ((player->cmd.ucmd.buttons & BT_USE || - ((deathmatch || alwaysapplydmflags) && (dmflags & DF_FORCE_RESPAWN))) && !(dmflags2 & DF2_NO_RESPAWN)) + ((multiplayer || alwaysapplydmflags) && (dmflags & DF_FORCE_RESPAWN))) && !(dmflags2 & DF2_NO_RESPAWN)) { if (level.time >= player->respawn_time || ((player->cmd.ucmd.buttons & BT_USE) && !player->isbot)) {