diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index a224de71e..72b315484 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -124,12 +124,12 @@ namespace MWClass data->mContainerStore = new MWWorld::ContainerStore(); // Relates to NPC gold reset delay - data->mCreatureStats.setTradeTime (MWBase::Environment::get().getWorld()->getTimeStamp()); + data->mCreatureStats.setTradeTime(MWWorld::TimeStamp(0.0, 0)); data->mCreatureStats.setGoldPool(ref->mBase->mData.mGold); // store - ptr.getRefData().setCustomData (data.release()); + ptr.getRefData().setCustomData(data.release()); getContainerStore(ptr).fill(ref->mBase->mInventory, getId(ptr), "", MWBase::Environment::get().getWorld()->getStore()); diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 502ff6ef6..020f3b3af 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -358,7 +358,7 @@ namespace MWClass MWBase::Environment::get().getWorld()->getStore()); // Relates to NPC gold reset delay - data->mNpcStats.setTradeTime(MWBase::Environment::get().getWorld()->getTimeStamp()); + data->mNpcStats.setTradeTime(MWWorld::TimeStamp(0.0, 0)); data->mNpcStats.setGoldPool(gold); diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index 41c3cd197..0525a97ae 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -484,7 +484,6 @@ namespace MWGui void TradeWindow::checkTradeTime() { MWWorld::ContainerStore store = mPtr.getClass().getContainerStore(mPtr); - MWWorld::LiveCellRef *ref = mPtr.get(); const MWMechanics::CreatureStats &sellerStats = mPtr.getClass().getCreatureStats(mPtr); double delay = boost::lexical_cast(MWBase::Environment::get().getWorld()->getStore().get().find("fBarterGoldResetDelay")->getInt()); @@ -492,7 +491,7 @@ namespace MWGui if (MWBase::Environment::get().getWorld()->getTimeStamp() >= sellerStats.getTradeTime() + delay) { addOrRemoveGold(-store.count(MWWorld::ContainerStore::sGoldId), mPtr); - addOrRemoveGold(+ref->mBase->mNpdt52.mGold, mPtr); + addOrRemoveGold(+sellerStats.getGoldPool(), mPtr); } }