mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Remove some redundant checks
This commit is contained in:
parent
18a59df050
commit
ad9412a117
@ -780,7 +780,7 @@ namespace MWClass
|
||||
MWWorld::Ptr armor = ((armorslot != inv.end()) ? *armorslot : MWWorld::Ptr());
|
||||
if(!armor.isEmpty() && armor.getTypeName() == typeid(ESM::Armor).name())
|
||||
{
|
||||
if (attacker.isEmpty() || (!attacker.isEmpty() && !(object.isEmpty() && !attacker.getClass().isNpc()))) // Unarmed creature attacks don't affect armor condition
|
||||
if (!object.isEmpty() || attacker.isEmpty() || attacker.getClass().isNpc()) // Unarmed creature attacks don't affect armor condition
|
||||
{
|
||||
int armorhealth = armor.getClass().getItemHealth(armor);
|
||||
armorhealth -= std::min(damageDiff, armorhealth);
|
||||
|
@ -262,7 +262,7 @@ namespace MWGui
|
||||
|
||||
if (mode == GM_Console)
|
||||
MWBase::Environment::get().getWindowManager()->setConsoleSelectedObject(object);
|
||||
else if ((mode == GM_Container) || (mode == GM_Inventory))
|
||||
else //if ((mode == GM_Container) || (mode == GM_Inventory))
|
||||
{
|
||||
// pick up object
|
||||
if (!object.isEmpty())
|
||||
|
@ -328,8 +328,9 @@ void ActorAnimation::updateQuiver()
|
||||
suitableAmmo = ammo->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::Arrow;
|
||||
}
|
||||
|
||||
if (ammoNode && suitableAmmo)
|
||||
{
|
||||
if (!suitableAmmo)
|
||||
return;
|
||||
|
||||
// We should not show more ammo than equipped and more than quiver mesh has
|
||||
ammoCount = std::min(ammoCount, ammoNode->getNumChildren());
|
||||
|
||||
@ -355,7 +356,6 @@ void ActorAnimation::updateQuiver()
|
||||
addGlow(arrow, glowColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ActorAnimation::itemAdded(const MWWorld::ConstPtr& item, int /*count*/)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user