forked from teamnwah/openmw-tes3coop
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:
|
case REC_BOOK:
|
||||||
{
|
{
|
||||||
Book b;
|
Book b;
|
||||||
b.load(esm);
|
b.load(esm, id);
|
||||||
if(quiet) break;
|
if(quiet) break;
|
||||||
cout << " Name: " << b.name << endl;
|
cout << " Name: " << b.name << endl;
|
||||||
cout << " Mesh: " << b.model << endl;
|
cout << " Mesh: " << b.model << endl;
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace MWWorld
|
||||||
|
|
||||||
// Skill gain from books
|
// Skill gain from books
|
||||||
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length
|
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>();
|
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
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.increaseSkill (ref->base->data.skillID, *class_, true);
|
||||||
|
|
||||||
npcStats.flagAsUsed (ref->base->name);
|
npcStats.flagAsUsed (ref->base->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
|
|
||||||
void Book::load(ESMReader &esm)
|
void Book::load(ESMReader &esm, const std::string& recordId)
|
||||||
{
|
{
|
||||||
model = esm.getHNString("MODL");
|
model = esm.getHNString("MODL");
|
||||||
name = esm.getHNOString("FNAM");
|
name = esm.getHNOString("FNAM");
|
||||||
|
@ -12,6 +12,7 @@ void Book::load(ESMReader &esm)
|
||||||
icon = esm.getHNOString("ITEX");
|
icon = esm.getHNOString("ITEX");
|
||||||
text = esm.getHNOString("TEXT");
|
text = esm.getHNOString("TEXT");
|
||||||
enchant = esm.getHNOString("ENAM");
|
enchant = esm.getHNOString("ENAM");
|
||||||
|
id = recordId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,9 @@ struct Book
|
||||||
|
|
||||||
BKDTstruct data;
|
BKDTstruct data;
|
||||||
std::string name, model, icon, script, enchant, text;
|
std::string name, model, icon, script, enchant, text;
|
||||||
|
std::string id;
|
||||||
|
|
||||||
void load(ESMReader &esm);
|
void load(ESMReader &esm, const std::string& recordId);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace ESMS
|
||||||
RecListT<Apparatus> appas;
|
RecListT<Apparatus> appas;
|
||||||
RecListT<Armor> armors;
|
RecListT<Armor> armors;
|
||||||
RecListT<BodyPart> bodyParts;
|
RecListT<BodyPart> bodyParts;
|
||||||
RecListT<Book> books;
|
RecListWithIDT<Book> books;
|
||||||
RecListT<BirthSign> birthSigns;
|
RecListT<BirthSign> birthSigns;
|
||||||
RecListT<Class> classes;
|
RecListT<Class> classes;
|
||||||
RecListT<Clothing> clothes;
|
RecListT<Clothing> clothes;
|
||||||
|
|
Loading…
Reference in a new issue