mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-23 19:20:56 +00:00
Fixed assorted issues
* destructor is virtual * renamed class to Actor * corrected indentation of case statement
This commit is contained in:
parent
bb54bbd273
commit
541d7fb4fb
@ -74,7 +74,7 @@ add_openmw_dir (mwphysics
|
||||
|
||||
add_openmw_dir (mwclass
|
||||
classes activator creature npc weapon armor potion apparatus book clothing container door
|
||||
ingredient creaturelevlist itemlevlist light lockpick misc probe repair static mobile
|
||||
ingredient creaturelevlist itemlevlist light lockpick misc probe repair static actor
|
||||
)
|
||||
|
||||
add_openmw_dir (mwmechanics
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "mobile.hpp"
|
||||
#include "actor.hpp"
|
||||
|
||||
#include <components/esm/loadmgef.hpp>
|
||||
|
||||
@ -17,16 +17,16 @@
|
||||
|
||||
namespace MWClass
|
||||
{
|
||||
Mobile::Mobile() {}
|
||||
Actor::Actor() {}
|
||||
|
||||
Mobile::~Mobile() {}
|
||||
Actor::~Actor() {}
|
||||
|
||||
void Mobile::adjustPosition(const MWWorld::Ptr& ptr, bool force) const
|
||||
void Actor::adjustPosition(const MWWorld::Ptr& ptr, bool force) const
|
||||
{
|
||||
MWBase::Environment::get().getWorld()->adjustPosition(ptr, force);
|
||||
}
|
||||
|
||||
void Mobile::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Actor::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
if (!model.empty())
|
||||
{
|
||||
@ -37,7 +37,7 @@ namespace MWClass
|
||||
MWBase::Environment::get().getMechanicsManager()->add(ptr);
|
||||
}
|
||||
|
||||
void Mobile::block(const MWWorld::Ptr &ptr) const
|
||||
void Actor::block(const MWWorld::Ptr &ptr) const
|
||||
{
|
||||
MWWorld::InventoryStore& inv = getInventoryStore(ptr);
|
||||
MWWorld::ContainerStoreIterator shield = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||
@ -47,26 +47,26 @@ namespace MWClass
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
switch (shield->getClass().getEquipmentSkill(*shield))
|
||||
{
|
||||
case ESM::Skill::LightArmor:
|
||||
sndMgr->playSound3D(ptr, "Light Armor Hit", 1.0f, 1.0f);
|
||||
break;
|
||||
case ESM::Skill::MediumArmor:
|
||||
sndMgr->playSound3D(ptr, "Medium Armor Hit", 1.0f, 1.0f);
|
||||
break;
|
||||
case ESM::Skill::HeavyArmor:
|
||||
sndMgr->playSound3D(ptr, "Heavy Armor Hit", 1.0f, 1.0f);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
case ESM::Skill::LightArmor:
|
||||
sndMgr->playSound3D(ptr, "Light Armor Hit", 1.0f, 1.0f);
|
||||
break;
|
||||
case ESM::Skill::MediumArmor:
|
||||
sndMgr->playSound3D(ptr, "Medium Armor Hit", 1.0f, 1.0f);
|
||||
break;
|
||||
case ESM::Skill::HeavyArmor:
|
||||
sndMgr->playSound3D(ptr, "Heavy Armor Hit", 1.0f, 1.0f);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool Mobile::hasToolTip(const MWWorld::Ptr& ptr) const
|
||||
bool Actor::hasToolTip(const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
return !ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat() || getCreatureStats(ptr).isDead();
|
||||
}
|
||||
|
||||
osg::Vec3f Mobile::getRotationVector(const MWWorld::Ptr& ptr) const
|
||||
osg::Vec3f Actor::getRotationVector(const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWMechanics::Movement &movement = getMovementSettings(ptr);
|
||||
osg::Vec3f vec(movement.mRotation[0], movement.mRotation[1], movement.mRotation[2]);
|
||||
@ -76,7 +76,7 @@ namespace MWClass
|
||||
return vec;
|
||||
}
|
||||
|
||||
float Mobile::getEncumbrance(const MWWorld::Ptr& ptr) const
|
||||
float Actor::getEncumbrance(const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
float weight = getContainerStore(ptr).getWeight();
|
||||
const MWMechanics::MagicEffects& effects = getCreatureStats(ptr).getMagicEffects();
|
@ -11,14 +11,14 @@ namespace ESM
|
||||
namespace MWClass
|
||||
{
|
||||
/// \brief Class holding functionality common to Creature and NPC
|
||||
class Mobile : public MWWorld::Class
|
||||
class Actor : public MWWorld::Class
|
||||
{
|
||||
protected:
|
||||
|
||||
Mobile();
|
||||
Actor();
|
||||
|
||||
public:
|
||||
~Mobile();
|
||||
virtual ~Actor();
|
||||
|
||||
virtual void adjustPosition(const MWWorld::Ptr& ptr, bool force) const;
|
||||
///< Adjust position to stand on ground. Must be called post model load
|
||||
@ -39,8 +39,8 @@ namespace MWClass
|
||||
/// effects). Throws an exception, if the object can't hold other objects.
|
||||
|
||||
// not implemented
|
||||
Mobile(const Mobile&);
|
||||
Mobile& operator= (const Mobile&);
|
||||
Actor(const Actor&);
|
||||
Actor& operator= (const Actor&);
|
||||
};
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GAME_MWCLASS_CREATURE_H
|
||||
#define GAME_MWCLASS_CREATURE_H
|
||||
|
||||
#include "mobile.hpp"
|
||||
#include "actor.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
@ -10,7 +10,7 @@ namespace ESM
|
||||
|
||||
namespace MWClass
|
||||
{
|
||||
class Creature : public Mobile
|
||||
class Creature : public Actor
|
||||
{
|
||||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
@ -946,7 +946,7 @@ namespace MWClass
|
||||
{
|
||||
// According to UESP, inventory weight is ignored in werewolf form. Does that include
|
||||
// feather and burden effects?
|
||||
return getNpcStats(ptr).isWerewolf() ? 0.0f : Mobile::getEncumbrance(ptr);
|
||||
return getNpcStats(ptr).isWerewolf() ? 0.0f : Actor::getEncumbrance(ptr);
|
||||
}
|
||||
|
||||
bool Npc::apply (const MWWorld::Ptr& ptr, const std::string& id,
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GAME_MWCLASS_NPC_H
|
||||
#define GAME_MWCLASS_NPC_H
|
||||
|
||||
#include "mobile.hpp"
|
||||
#include "actor.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
@ -10,7 +10,7 @@ namespace ESM
|
||||
|
||||
namespace MWClass
|
||||
{
|
||||
class Npc : public Mobile
|
||||
class Npc : public Actor
|
||||
{
|
||||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user