1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:23:52 +00:00

select the correct gold base object (still crashing)

This commit is contained in:
scrawl 2012-05-16 22:13:56 +02:00
parent f73d3ad33f
commit 5875ce5128

View file

@ -988,20 +988,19 @@ namespace MWWorld
int goldAmount = object.getRefData().getCount();
std::string base = "Gold_001";
if (goldAmount >= 5)
base = "Gold_005";
else if (goldAmount >= 10)
base = "Gold_010";
if (goldAmount >= 100)
base = "Gold_100";
else if (goldAmount >= 25)
base = "Gold_025";
else if (goldAmount >= 100)
base = "Gold_100";
else if (goldAmount >= 10)
base = "Gold_010";
else if (goldAmount >= 5)
base = "Gold_005";
std::cout << "using " << base << std::endl;
MWWorld::ManualRef newRef (getStore(), base);
object = newRef.getPtr();
object.getRefData().setCount(goldAmount);
object.mCell = cell;
}
ESM::Position& pos = object.getRefData().getPosition();