mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 12:39:55 +00:00
Merge pull request #2376 from Capostrophic/getweapontype
GetWeaponType returns -2 for picks and -3 for probes (feature #5031)
This commit is contained in:
commit
4af9315672
@ -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…
x
Reference in New Issue
Block a user