diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f45037b..d5acfd089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,7 @@ Feature #4994: Persistent pinnable windows hiding Feature #5000: Compressed BSA format support Feature #5010: Native graphics herbalism support + Feature #5031: Make GetWeaponType function return different values for tools Task #4686: Upgrade media decoder to a more current FFmpeg API Task #4695: Optimize Distant Terrain memory consumption Task #4721: Add NMake support to the Windows prebuild script diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index db50ff621..38b7482eb 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -354,11 +354,27 @@ namespace MWScript const MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr); MWWorld::ConstContainerStoreIterator it = invStore.getSlot (MWWorld::InventoryStore::Slot_CarriedRight); - if (it == invStore.end() || it->getTypeName () != typeid(ESM::Weapon).name()) + if (it == invStore.end()) { runtime.push(-1); return; } + else if (it->getTypeName() != typeid(ESM::Weapon).name()) + { + if (it->getTypeName() == typeid(ESM::Lockpick).name()) + { + runtime.push(-2); + } + else if (it->getTypeName() == typeid(ESM::Probe).name()) + { + runtime.push(-3); + } + else + { + runtime.push(-1); + } + return; + } runtime.push(it->get()->mBase->mData.mType); }