[Client] Unequip items with constant effect damage when resurrected

This commit is contained in:
David Cernat 2018-01-27 20:19:39 +02:00
parent d19d8b0a34
commit d7e29f1f61

View file

@ -803,6 +803,14 @@ void LocalPlayer::resurrect()
LOG_APPEND(Log::LOG_INFO, "- diedSinceArrestAttempt is now true"); 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)->setPlayer(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_RESURRECT)->Send(); Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_RESURRECT)->Send();