forked from teamnwah/openmw-tes3coop
[Client] Avoid repetitive code when unequipping items in resurrection
This commit is contained in:
parent
b5b26c6685
commit
d05a82a734
1 changed files with 5 additions and 5 deletions
|
@ -836,11 +836,11 @@ void LocalPlayer::resurrect()
|
|||
|
||||
// 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);
|
||||
static const int damageEffects[5] = { ESM::MagicEffect::DrainHealth, ESM::MagicEffect::FireDamage,
|
||||
ESM::MagicEffect::FrostDamage, ESM::MagicEffect::ShockDamage, ESM::MagicEffect::SunDamage };
|
||||
|
||||
for (const auto &damageEffect : damageEffects)
|
||||
MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, damageEffect);
|
||||
|
||||
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_RESURRECT)->setPlayer(this);
|
||||
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_RESURRECT)->Send();
|
||||
|
|
Loading…
Reference in a new issue