mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 16:45:33 +00:00
Accept a ConstPtr in copyToCell
This commit is contained in:
parent
954186fe1e
commit
da7ebfde99
38 changed files with 62 additions and 114 deletions
|
@ -120,11 +120,9 @@ namespace MWClass
|
|||
}
|
||||
|
||||
|
||||
MWWorld::Ptr
|
||||
Activator::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Activator::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
const MWWorld::LiveCellRef<ESM::Activator> *ref = ptr.get<ESM::Activator>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ namespace MWClass
|
|||
class Activator : public MWWorld::Class
|
||||
{
|
||||
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -135,11 +135,9 @@ namespace MWClass
|
|||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionAlchemy());
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Apparatus::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Apparatus::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
const MWWorld::LiveCellRef<ESM::Apparatus> *ref = ptr.get<ESM::Apparatus>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ namespace MWClass
|
|||
class Apparatus : public MWWorld::Class
|
||||
{
|
||||
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -365,11 +365,9 @@ namespace MWClass
|
|||
return action;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Armor::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Armor::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
const MWWorld::LiveCellRef<ESM::Armor> *ref = ptr.get<ESM::Armor>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Armor : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -173,11 +173,9 @@ namespace MWClass
|
|||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Book::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Book::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
const MWWorld::LiveCellRef<ESM::Book> *ref = ptr.get<ESM::Book>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Book : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -258,11 +258,9 @@ namespace MWClass
|
|||
return action;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Clothing::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Clothing::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Clothing : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -284,10 +284,9 @@ namespace MWClass
|
|||
return true;
|
||||
}
|
||||
|
||||
MWWorld::Ptr Container::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Container::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
const MWWorld::LiveCellRef<ESM::Container> *ref = ptr.get<ESM::Container>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ namespace MWClass
|
|||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -590,11 +590,9 @@ namespace MWClass
|
|||
return "";
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Creature::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Creature::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
const MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ namespace MWClass
|
|||
{
|
||||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
static int getSndGenTypeFromName(const MWWorld::Ptr &ptr, const std::string &name);
|
||||
|
||||
|
|
|
@ -299,11 +299,9 @@ namespace MWClass
|
|||
return "#{sCell=" + dest + "}";
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Door::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Door::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
const MWWorld::LiveCellRef<ESM::Door> *ref = ptr.get<ESM::Door>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ namespace MWClass
|
|||
{
|
||||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -172,11 +172,9 @@ namespace MWClass
|
|||
return info;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Ingredient::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Ingredient::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
const MWWorld::LiveCellRef<ESM::Ingredient> *ref = ptr.get<ESM::Ingredient>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Ingredient : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -203,11 +203,9 @@ namespace MWClass
|
|||
return ptr.getCellRef().getChargeFloat();
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Light::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Light::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
const MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Light : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -153,11 +153,9 @@ namespace MWClass
|
|||
return action;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Lockpick::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Lockpick::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Lockpick> *ref =
|
||||
ptr.get<ESM::Lockpick>();
|
||||
const MWWorld::LiveCellRef<ESM::Lockpick> *ref = ptr.get<ESM::Lockpick>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Lockpick : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -182,8 +182,7 @@ namespace MWClass
|
|||
return info;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Miscellaneous::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Miscellaneous::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::Ptr newPtr;
|
||||
|
||||
|
@ -206,14 +205,14 @@ namespace MWClass
|
|||
// Really, I have no idea why moving ref out of conditional
|
||||
// scope causes list::push_back throwing std::bad_alloc
|
||||
MWWorld::ManualRef newRef(store, base);
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
newRef.getPtr().get<ESM::Miscellaneous>();
|
||||
|
||||
newPtr = MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
newPtr.getCellRef().setGoldValue(goldAmount);
|
||||
newPtr.getRefData().setCount(1);
|
||||
} else {
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
newPtr = MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Miscellaneous : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -1124,11 +1124,9 @@ namespace MWClass
|
|||
throw std::runtime_error(std::string("Unexpected soundgen type: ")+name);
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Npc::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Npc::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ namespace MWClass
|
|||
{
|
||||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
struct GMST
|
||||
{
|
||||
|
|
|
@ -166,11 +166,9 @@ namespace MWClass
|
|||
return action;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Potion::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Potion::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
const MWWorld::LiveCellRef<ESM::Potion> *ref = ptr.get<ESM::Potion>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Potion : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -153,11 +153,9 @@ namespace MWClass
|
|||
return action;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Probe::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Probe::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
const MWWorld::LiveCellRef<ESM::Probe> *ref = ptr.get<ESM::Probe>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Probe : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -147,11 +147,9 @@ namespace MWClass
|
|||
return info;
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Repair::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Repair::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
const MWWorld::LiveCellRef<ESM::Repair> *ref = ptr.get<ESM::Repair>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Repair : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -52,11 +52,9 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Static).name(), instance);
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Static::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
MWWorld::Ptr Static::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Static> *ref =
|
||||
ptr.get<ESM::Static>();
|
||||
const MWWorld::LiveCellRef<ESM::Static> *ref = ptr.get<ESM::Static>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace MWClass
|
|||
{
|
||||
class Static : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -399,10 +399,9 @@ namespace MWClass
|
|||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Weapon::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
|
||||
Weapon::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
|
||||
|
||||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace MWClass
|
|||
class Weapon : public MWWorld::Class
|
||||
{
|
||||
virtual MWWorld::Ptr
|
||||
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
||||
copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -333,13 +333,13 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Class::copyToCellImpl(const Ptr &ptr, CellStore &cell) const
|
||||
Class::copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const
|
||||
{
|
||||
throw std::runtime_error("unable to move class to cell");
|
||||
throw std::runtime_error("unable to copy class to cell");
|
||||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Class::copyToCell(const Ptr &ptr, CellStore &cell) const
|
||||
Class::copyToCell(const ConstPtr &ptr, CellStore &cell) const
|
||||
{
|
||||
Ptr newPtr = copyToCellImpl(ptr, cell);
|
||||
newPtr.getCellRef().unsetRefNum(); // This RefNum is only valid within the original cell of the reference
|
||||
|
@ -347,7 +347,7 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
MWWorld::Ptr
|
||||
Class::copyToCell(const Ptr &ptr, CellStore &cell, const ESM::Position &pos) const
|
||||
Class::copyToCell(const ConstPtr &ptr, CellStore &cell, const ESM::Position &pos) const
|
||||
{
|
||||
Ptr newPtr = copyToCell(ptr, cell);
|
||||
newPtr.getRefData().setPosition(pos);
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace MWWorld
|
|||
boost::shared_ptr<Action> defaultItemActivate(const Ptr &ptr, const Ptr &actor) const;
|
||||
///< Generate default action for activating inventory items
|
||||
|
||||
virtual Ptr copyToCellImpl(const Ptr &ptr, CellStore &cell) const;
|
||||
virtual Ptr copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -286,11 +286,9 @@ namespace MWWorld
|
|||
/// Get a blood texture suitable for \a ptr (see Blood Texture 0-2 in Morrowind.ini)
|
||||
virtual int getBloodTexture (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
virtual Ptr
|
||||
copyToCell(const Ptr &ptr, CellStore &cell) const;
|
||||
virtual Ptr copyToCell(const ConstPtr &ptr, CellStore &cell) const;
|
||||
|
||||
virtual Ptr
|
||||
copyToCell(const Ptr &ptr, CellStore &cell, const ESM::Position &pos) const;
|
||||
virtual Ptr copyToCell(const ConstPtr &ptr, CellStore &cell, const ESM::Position &pos) const;
|
||||
|
||||
virtual bool isActor() const {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue