forked from mirror/openmw-tes3mp
change books to RecListWithIDT
This commit is contained in:
parent
853d62adba
commit
d163f8203c
5 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace ESMS
|
|||
RecListT<Apparatus> appas;
|
||||
RecListT<Armor> armors;
|
||||
RecListT<BodyPart> bodyParts;
|
||||
RecListT<Book> books;
|
||||
RecListWithIDT<Book> books;
|
||||
RecListT<BirthSign> birthSigns;
|
||||
RecListT<Class> classes;
|
||||
RecListT<Clothing> clothes;
|
||||
|
|
Loading…
Reference in a new issue