1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 17:19:39 +00:00

add missing item when executing the Equip instruction

This commit is contained in:
Marc Zinnschlag 2016-09-06 16:33:26 +02:00
parent 48c257b939
commit 03a35c38df

View file

@ -188,7 +188,11 @@ namespace MWScript
break;
}
if (it == invStore.end())
throw std::runtime_error("Item to equip not found");
{
it = ptr.getClass().getContainerStore (ptr).add (item, 1, ptr);
std::cerr << "Implicitly adding one " << item << " to container "
"to fulfil requirements of Equip instruction" << std::endl;
}
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
MWBase::Environment::get().getWindowManager()->useItem(*it);