GetWeaponType returns -2 for picks and -3 for probes (feature #5031)

pull/2376/head
Capostrophic 5 years ago
parent 0cea76c684
commit 62482657fc

@ -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

@ -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<ESM::Weapon>()->mBase->mData.mType);
}

Loading…
Cancel
Save