From d7e29f1f61f7cddabe8c07fc1882e0294f783530 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 27 Jan 2018 20:19:39 +0200 Subject: [PATCH] [Client] Unequip items with constant effect damage when resurrected --- apps/openmw/mwmp/LocalPlayer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 64e04620e..5973ffea3 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -803,6 +803,14 @@ void LocalPlayer::resurrect() LOG_APPEND(Log::LOG_INFO, "- diedSinceArrestAttempt is now true"); + // Ensure we unequip any items with constant effects that can put us into an infinite + // death loop + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::DrainHealth); + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::FireDamage); + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::FrostDamage); + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::ShockDamage); + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::SunDamage); + Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_RESURRECT)->setPlayer(this); Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_RESURRECT)->Send();