forked from teamnwah/openmw-tes3coop
Gold condition now always checks RefID instead of the name. This is necessary because in the french MW version, the sGold GMST is different from the name of the gold references.
This commit is contained in:
parent
a359ba6a2f
commit
0079f62180
2 changed files with 22 additions and 23 deletions
|
@ -158,7 +158,12 @@ namespace MWClass
|
||||||
|
|
||||||
int count = ptr.getRefData().getCount();
|
int count = ptr.getRefData().getCount();
|
||||||
|
|
||||||
bool isGold = (ref->mBase->mName == store.get<ESM::GameSetting>().find("sGold")->getString());
|
bool isGold = Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_001")
|
||||||
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_005")
|
||||||
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_010")
|
||||||
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_025")
|
||||||
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_100");
|
||||||
|
|
||||||
if (isGold && ptr.getCellRef().mGoldValue != 1)
|
if (isGold && ptr.getCellRef().mGoldValue != 1)
|
||||||
count = ptr.getCellRef().mGoldValue;
|
count = ptr.getCellRef().mGoldValue;
|
||||||
else if (isGold)
|
else if (isGold)
|
||||||
|
|
|
@ -111,16 +111,11 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr)
|
||||||
|
|
||||||
// gold needs special handling: when it is inserted into a container, the base object automatically becomes Gold_001
|
// gold needs special handling: when it is inserted into a container, the base object automatically becomes Gold_001
|
||||||
// this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold)
|
// this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold)
|
||||||
if (MWWorld::Class::get(ptr).getName(ptr) == esmStore.get<ESM::GameSetting>().find("sGold")->getString())
|
if (Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_001")
|
||||||
{
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_005")
|
||||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *gold =
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_010")
|
||||||
ptr.get<ESM::Miscellaneous>();
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_025")
|
||||||
|
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_100"))
|
||||||
if (Misc::StringUtils::ciEqual(gold->mRef.mRefID, "gold_001")
|
|
||||||
|| Misc::StringUtils::ciEqual(gold->mRef.mRefID, "gold_005")
|
|
||||||
|| Misc::StringUtils::ciEqual(gold->mRef.mRefID, "gold_010")
|
|
||||||
|| Misc::StringUtils::ciEqual(gold->mRef.mRefID, "gold_025")
|
|
||||||
|| Misc::StringUtils::ciEqual(gold->mRef.mRefID, "gold_100"))
|
|
||||||
{
|
{
|
||||||
MWWorld::ManualRef ref(esmStore, "Gold_001");
|
MWWorld::ManualRef ref(esmStore, "Gold_001");
|
||||||
|
|
||||||
|
@ -139,7 +134,6 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr)
|
||||||
|
|
||||||
return addImpl(ref.getPtr());
|
return addImpl(ref.getPtr());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// determine whether to stack or not
|
// determine whether to stack or not
|
||||||
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
|
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
|
||||||
|
|
Loading…
Reference in a new issue