Switching creature and npc to using the same id storage as the rest of the records

actorid
Alexander "Ace" Olofsson 13 years ago
parent f0c32ba7d3
commit 290d09de64

@ -410,7 +410,6 @@ int load(Arguments& info)
{
rec = new Creature();
Creature& b = *(Creature*)rec;
b.setID(id);
b.load(esm);
if(quiet) break;
cout << " Name: " << b.name << endl;

@ -65,7 +65,7 @@ namespace MWClass
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
ptr.get<ESM::Creature>();
return ref->base->mId;
return ref->base->getId();
}
void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const

@ -88,7 +88,7 @@ namespace MWClass
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
ptr.get<ESM::NPC>();
return ref->base->mId;
return ref->base->getId();
}
void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const

@ -2,11 +2,6 @@
namespace ESM {
void Creature::setID(const std::string& id)
{
mId = id;
}
void Creature::load(ESMReader &esm)
{
model = esm.getHNString("MODL");

@ -63,9 +63,6 @@ struct Creature : public Record
// Defined in loadcont.hpp
InventoryList inventory;
std::string mId;
void setID(const std::string& id);
void load(ESMReader &esm);
void save(ESMWriter &esm);

@ -3,11 +3,6 @@
namespace ESM
{
void NPC::setID(const std::string& id)
{
mId = id;
}
void NPC::load(ESMReader &esm)
{
npdt52.gold = -10;

@ -100,10 +100,9 @@ struct NPC : public Record
std::string name, model, race, cls, faction, script,
hair, head; // body parts
std::string mId;
//std::string mId;
// Implementation moved to load_impl.cpp
void setID(const std::string& id);
void load(ESMReader &esm);
void save(ESMWriter &esm);

@ -64,7 +64,7 @@ public:
virtual void load(ESMReader& esm) = 0;
virtual void save(ESMWriter& esm) = 0;
std::string getId() { return m_id; }
std::string getId() const { return m_id; }
void setId(const std::string& in) { m_id = in; }
virtual int getName() = 0;

@ -104,7 +104,7 @@ namespace ESMS
void load(ESMReader &esm, const std::string &id)
{
std::string id2 = toLower (id);
list[id2].setID(id2);
list[id2].setId(id2);
list[id2].load(esm);
}

Loading…
Cancel
Save