From d163f8203c17355d5ce80fe895582a54a735c757 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 25 Sep 2012 21:38:34 +0200 Subject: [PATCH] change books to RecListWithIDT --- apps/esmtool/esmtool.cpp | 2 +- apps/openmw/mwworld/actionread.cpp | 4 ++-- components/esm/loadbook.cpp | 3 ++- components/esm/loadbook.hpp | 3 ++- components/esm_store/store.hpp | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp index 4888d3ceb5..ac2746a89c 100644 --- a/apps/esmtool/esmtool.cpp +++ b/apps/esmtool/esmtool.cpp @@ -226,7 +226,7 @@ int main(int argc, char**argv) case REC_BOOK: { Book b; - b.load(esm); + b.load(esm, id); if(quiet) break; cout << " Name: " << b.name << endl; cout << " Mesh: " << b.model << endl; diff --git a/apps/openmw/mwworld/actionread.cpp b/apps/openmw/mwworld/actionread.cpp index 59c1e722f2..ed118d9b80 100644 --- a/apps/openmw/mwworld/actionread.cpp +++ b/apps/openmw/mwworld/actionread.cpp @@ -40,7 +40,7 @@ namespace MWWorld // Skill gain from books if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length - && !npcStats.hasBeenUsed (ref->base->name)) + && !npcStats.hasBeenUsed (ref->base->id)) { MWWorld::LiveCellRef *playerRef = player.get(); const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find ( @@ -48,7 +48,7 @@ namespace MWWorld npcStats.increaseSkill (ref->base->data.skillID, *class_, true); - npcStats.flagAsUsed (ref->base->name); + npcStats.flagAsUsed (ref->base->id); } } diff --git a/components/esm/loadbook.cpp b/components/esm/loadbook.cpp index ffa958e144..48d9aed0da 100644 --- a/components/esm/loadbook.cpp +++ b/components/esm/loadbook.cpp @@ -3,7 +3,7 @@ namespace ESM { -void Book::load(ESMReader &esm) +void Book::load(ESMReader &esm, const std::string& recordId) { model = esm.getHNString("MODL"); name = esm.getHNOString("FNAM"); @@ -12,6 +12,7 @@ void Book::load(ESMReader &esm) icon = esm.getHNOString("ITEX"); text = esm.getHNOString("TEXT"); enchant = esm.getHNOString("ENAM"); + id = recordId; } } diff --git a/components/esm/loadbook.hpp b/components/esm/loadbook.hpp index 3a4ab441e8..525c21d336 100644 --- a/components/esm/loadbook.hpp +++ b/components/esm/loadbook.hpp @@ -20,8 +20,9 @@ struct Book BKDTstruct data; std::string name, model, icon, script, enchant, text; + std::string id; - void load(ESMReader &esm); + void load(ESMReader &esm, const std::string& recordId); }; } #endif diff --git a/components/esm_store/store.hpp b/components/esm_store/store.hpp index 991925bd47..7329386d4a 100644 --- a/components/esm_store/store.hpp +++ b/components/esm_store/store.hpp @@ -34,7 +34,7 @@ namespace ESMS RecListT appas; RecListT armors; RecListT bodyParts; - RecListT books; + RecListWithIDT books; RecListT birthSigns; RecListT classes; RecListT clothes;