mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-06 19:01:21 +03:00
modified Npc and Creature class to let them store a copy of their own ID
This commit is contained in:
parent
7afc8ffd2e
commit
8d85211fa1
6 changed files with 88 additions and 25 deletions
|
@ -180,7 +180,7 @@ int main(int argc, char**argv)
|
|||
case REC_CREA:
|
||||
{
|
||||
Creature b;
|
||||
b.load(esm);
|
||||
b.load(esm, id);
|
||||
if(quiet) break;
|
||||
cout << " Name: " << b.name << endl;
|
||||
break;
|
||||
|
|
|
@ -36,6 +36,23 @@ namespace MWWorld
|
|||
return false;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool create (const ESMS::RecListWithIDT<T>& list, const std::string& name)
|
||||
{
|
||||
if (const T *instance = list.search (name))
|
||||
{
|
||||
ESMS::LiveCellRef<T, RefData> ref;
|
||||
ref.base = instance;
|
||||
|
||||
mRef = ref;
|
||||
mPtr = Ptr (&boost::any_cast<ESMS::LiveCellRef<T, RefData>&> (mRef), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
ManualRef (const ESMS::ESMStore& store, const std::string& name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue