mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 05:45:34 +00:00
Accept a ConstPtr in getModel
This commit is contained in:
parent
d9bbd83b09
commit
f258c5c508
38 changed files with 56 additions and 93 deletions
|
@ -45,11 +45,9 @@ namespace MWClass
|
|||
MWBase::Environment::get().getMechanicsManager()->add(ptr);
|
||||
}
|
||||
|
||||
std::string Activator::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Activator::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Activator> *ref = ptr.get<ESM::Activator>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -37,11 +37,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Apparatus::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Apparatus::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Apparatus> *ref = ptr.get<ESM::Apparatus>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace MWClass
|
|||
const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual bool canSell (const MWWorld::Ptr& item, int npcServices) const;
|
||||
};
|
||||
|
|
|
@ -43,11 +43,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Armor::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Armor::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Armor> *ref = ptr.get<ESM::Armor>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace MWClass
|
|||
const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
|
|
@ -40,11 +40,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Book::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Book::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Book> *ref = ptr.get<ESM::Book>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace MWClass
|
|||
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
|
|
@ -39,11 +39,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Clothing::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Clothing::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace MWClass
|
|||
const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
|
|
@ -107,11 +107,9 @@ namespace MWClass
|
|||
MWBase::Environment::get().getMechanicsManager()->add(ptr);
|
||||
}
|
||||
|
||||
std::string Container::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Container::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Container> *ref = ptr.get<ESM::Container>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace MWClass
|
|||
|
||||
virtual void restock (const MWWorld::Ptr &ptr) const;
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -175,11 +175,9 @@ namespace MWClass
|
|||
objects.insertCreature(ptr, model, hasInventoryStore(ptr));
|
||||
}
|
||||
|
||||
std::string Creature::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Creature::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
assert (ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual bool
|
||||
isActor() const {
|
||||
|
|
|
@ -78,11 +78,9 @@ namespace MWClass
|
|||
MWBase::Environment::get().getMechanicsManager()->add(ptr);
|
||||
}
|
||||
|
||||
std::string Door::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Door::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Door> *ref = ptr.get<ESM::Door>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
/// 0 = nothing, 1 = opening, 2 = closing
|
||||
virtual int getDoorState (const MWWorld::Ptr &ptr) const;
|
||||
|
|
|
@ -43,11 +43,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Ingredient::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Ingredient::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Ingredient> *ref = ptr.get<ESM::Ingredient>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace MWClass
|
|||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual float getWeight (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
|
|
@ -59,11 +59,9 @@ namespace MWClass
|
|||
MWBase::Environment::get().getMechanicsManager()->add(ptr);
|
||||
}
|
||||
|
||||
std::string Light::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Light::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace MWClass
|
|||
virtual float getRemainingUsageTime (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Returns the remaining duration of the object.
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual float getWeight (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
|
|
@ -38,11 +38,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Lockpick::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Lockpick::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Lockpick> *ref =
|
||||
ptr.get<ESM::Lockpick>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Lockpick> *ref = ptr.get<ESM::Lockpick>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace MWClass
|
|||
const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual bool canSell (const MWWorld::Ptr& item, int npcServices) const;
|
||||
|
||||
|
|
|
@ -51,11 +51,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Miscellaneous::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Miscellaneous::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace MWClass
|
|||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
|
||||
const;
|
||||
|
|
|
@ -425,11 +425,9 @@ namespace MWClass
|
|||
return ref->mBase->mPersistent;
|
||||
}
|
||||
|
||||
std::string Npc::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Npc::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
std::string model = "meshes\\base_anim.nif";
|
||||
const ESM::Race* race = MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace);
|
||||
|
@ -437,7 +435,6 @@ namespace MWClass
|
|||
model = "meshes\\base_animkna.nif";
|
||||
|
||||
return model;
|
||||
|
||||
}
|
||||
|
||||
std::string Npc::getName (const MWWorld::ConstPtr& ptr) const
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getSkill(const MWWorld::Ptr& ptr, int skill) const;
|
||||
|
||||
|
|
|
@ -41,11 +41,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Potion::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Potion::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Potion> *ref = ptr.get<ESM::Potion>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual float getWeight (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
|
|
@ -38,11 +38,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Probe::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Probe::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Probe> *ref = ptr.get<ESM::Probe>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace MWClass
|
|||
const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual bool canSell (const MWWorld::Ptr& item, int npcServices) const;
|
||||
|
||||
|
|
|
@ -37,11 +37,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Repair::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Repair::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Repair> *ref = ptr.get<ESM::Repair>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace MWClass
|
|||
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const;
|
||||
///< Return name of inventory icon.
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
|
||||
const;
|
||||
|
|
|
@ -29,11 +29,9 @@ namespace MWClass
|
|||
physics.addObject(ptr, model);
|
||||
}
|
||||
|
||||
std::string Static::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Static::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Static> *ref =
|
||||
ptr.get<ESM::Static>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Static> *ref = ptr.get<ESM::Static>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -41,11 +41,9 @@ namespace MWClass
|
|||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Weapon::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Weapon::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
assert(ref->mBase != NULL);
|
||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace MWClass
|
|||
const;
|
||||
///< Generate action for using via inventory menu
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual bool canSell (const MWWorld::Ptr& item, int npcServices) const;
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ namespace MWWorld
|
|||
{
|
||||
}
|
||||
|
||||
std::string Class::getModel(const MWWorld::Ptr &ptr) const
|
||||
std::string Class::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -266,7 +266,7 @@ namespace MWWorld
|
|||
|
||||
virtual int getServices (const MWWorld::Ptr& actor) const;
|
||||
|
||||
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual std::string applyEnchantment(const MWWorld::Ptr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;
|
||||
///< Creates a new record using \a ptr as template, with the given name and the given enchantment applied to it.
|
||||
|
|
Loading…
Reference in a new issue