forked from mirror/openmw-tes3mp
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;
|
bool use = false;
|
||||||
|
|
||||||
if (slots.at (*iter2)==end())
|
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
|
else
|
||||||
{
|
{
|
||||||
Ptr old = *slots.at (*iter2);
|
Ptr old = *slots.at (*iter2);
|
||||||
|
@ -159,7 +159,9 @@ void MWWorld::InventoryStore::autoEquip (const MWMechanics::NpcStats& stats)
|
||||||
int oldSkill =
|
int oldSkill =
|
||||||
MWWorld::Class::get (old).getEquipmentSkill (old);
|
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())
|
if (stats.getSkill (oldSkill).getModified()>stats.getSkill (testSkill).getModified())
|
||||||
continue; // rejected, because old item better matched the NPC's skills.
|
continue; // rejected, because old item better matched the NPC's skills.
|
||||||
|
|
Loading…
Reference in a new issue