1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Fix OpAddItem, OpGetItemCount and OpRemoveItem.

This commit is contained in:
Koncord 2015-07-20 12:48:19 +09:00
parent a24df8cb66
commit 7a86c8d8b6

View File

@ -56,6 +56,12 @@ namespace MWScript
if (count == 0)
return;
if(Misc::StringUtils::ciEqual(item, "gold_005")
|| Misc::StringUtils::ciEqual(item, "gold_010")
|| Misc::StringUtils::ciEqual(item, "gold_025")
|| Misc::StringUtils::ciEqual(item, "gold_100"))
item = "gold_001";
MWWorld::Ptr itemPtr = *ptr.getClass().getContainerStore (ptr).add (item, count, ptr);
// Spawn a messagebox (only for items added to player's inventory and if player is talking to someone)
@ -91,6 +97,12 @@ namespace MWScript
std::string item = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
if(Misc::StringUtils::ciEqual(item, "gold_005")
|| Misc::StringUtils::ciEqual(item, "gold_010")
|| Misc::StringUtils::ciEqual(item, "gold_025")
|| Misc::StringUtils::ciEqual(item, "gold_100"))
item = "gold_001";
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
runtime.push (store.count(item));
@ -119,6 +131,12 @@ namespace MWScript
if (count == 0)
return;
if(Misc::StringUtils::ciEqual(item, "gold_005")
|| Misc::StringUtils::ciEqual(item, "gold_010")
|| Misc::StringUtils::ciEqual(item, "gold_025")
|| Misc::StringUtils::ciEqual(item, "gold_100"))
item = "gold_001";
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
std::string itemName;