mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-19 16:39:41 +00:00
fixed a logic error in the auto equip code
This commit is contained in:
parent
beb18282bb
commit
6744375636
1 changed files with 4 additions and 2 deletions
|
@ -148,7 +148,7 @@ void MWWorld::InventoryStore::autoEquip (const MWMechanics::NpcStats& stats)
|
|||
bool use = false;
|
||||
|
||||
if (slots.at (*iter2)==end())
|
||||
use = true; // slot was empty before -> skill all further checks
|
||||
use = true; // slot was empty before -> skip all further checks
|
||||
else
|
||||
{
|
||||
Ptr old = *slots.at (*iter2);
|
||||
|
@ -159,7 +159,9 @@ void MWWorld::InventoryStore::autoEquip (const MWMechanics::NpcStats& stats)
|
|||
int oldSkill =
|
||||
MWWorld::Class::get (old).getEquipmentSkill (old);
|
||||
|
||||
if (testSkill!=-1 || oldSkill!=-1 || testSkill!=oldSkill)
|
||||
if (testSkill!=-1 && oldSkill==-1)
|
||||
use = true;
|
||||
else if (testSkill!=-1 && oldSkill!=-1 && testSkill!=oldSkill)
|
||||
{
|
||||
if (stats.getSkill (oldSkill).getModified()>stats.getSkill (testSkill).getModified())
|
||||
continue; // rejected, because old item better matched the NPC's skills.
|
||||
|
|
Loading…
Reference in a new issue