Merge branch 'hammerthingstilltheybreak' into 'master'

Don't let the player repair items that are better than new

Closes #8171

See merge request OpenMW/openmw!4381
pull/3236/head
elsid 3 months ago
commit b6c1e33da6

@ -191,6 +191,7 @@
Bug #8097: GetEffect doesn't detect 0 magnitude spells Bug #8097: GetEffect doesn't detect 0 magnitude spells
Bug #8124: Normal weapon resistance is applied twice for NPCs Bug #8124: Normal weapon resistance is applied twice for NPCs
Bug #8132: Actors without hello responses turn to face the player Bug #8132: Actors without hello responses turn to face the player
Bug #8171: Items with more than 100% health can be repaired
Feature #1415: Infinite fall failsafe Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

@ -55,7 +55,7 @@ namespace MWGui
{ {
int maxDurability = iter->getClass().getItemMaxHealth(*iter); int maxDurability = iter->getClass().getItemMaxHealth(*iter);
int durability = iter->getClass().getItemHealth(*iter); int durability = iter->getClass().getItemHealth(*iter);
if (maxDurability == durability || maxDurability == 0) if (maxDurability <= durability || maxDurability == 0)
continue; continue;
int basePrice = iter->getClass().getValue(*iter); int basePrice = iter->getClass().getValue(*iter);

@ -288,7 +288,7 @@ namespace MWGui
if ((mFilter & Filter_OnlyRepairable) if ((mFilter & Filter_OnlyRepairable)
&& (!base.getClass().hasItemHealth(base) && (!base.getClass().hasItemHealth(base)
|| (base.getClass().getItemHealth(base) == base.getClass().getItemMaxHealth(base)) || (base.getClass().getItemHealth(base) >= base.getClass().getItemMaxHealth(base))
|| (base.getType() != ESM::Weapon::sRecordId && base.getType() != ESM::Armor::sRecordId))) || (base.getType() != ESM::Weapon::sRecordId && base.getType() != ESM::Armor::sRecordId)))
return false; return false;

Loading…
Cancel
Save