forked from teamnwah/openmw-tes3coop
Nothing to see here, move along.
Fine... it's flying cliff racers. But did you really want to know?
This commit is contained in:
parent
44e96fcaaa
commit
ce013315ba
5 changed files with 24 additions and 2 deletions
|
@ -413,6 +413,14 @@ namespace MWClass
|
||||||
return MWWorld::Ptr(&cell.mCreatures.insert(*ref), &cell);
|
return MWWorld::Ptr(&cell.mCreatures.insert(*ref), &cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Creature::isFlying(const MWWorld::Ptr &ptr) const
|
||||||
|
{
|
||||||
|
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||||
|
ptr.get<ESM::Creature>();
|
||||||
|
|
||||||
|
return ref->mBase->mFlags & ESM::Creature::Flies;
|
||||||
|
}
|
||||||
|
|
||||||
int Creature::getSndGenTypeFromName(const MWWorld::Ptr &ptr, const std::string &name)
|
int Creature::getSndGenTypeFromName(const MWWorld::Ptr &ptr, const std::string &name)
|
||||||
{
|
{
|
||||||
if(name == "left")
|
if(name == "left")
|
||||||
|
|
|
@ -99,6 +99,8 @@ namespace MWClass
|
||||||
isActor() const {
|
isActor() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool isFlying (const MWWorld::Ptr &ptr) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -372,4 +372,10 @@ namespace MWWorld
|
||||||
|
|
||||||
return newPtr;
|
return newPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Class::isFlying(const Ptr &ptr) const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,6 +306,8 @@ namespace MWWorld
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool isFlying(const MWWorld::Ptr& ptr) const;
|
||||||
|
|
||||||
static const Class& get (const std::string& key);
|
static const Class& get (const std::string& key);
|
||||||
///< If there is no class for this \a key, an exception is thrown.
|
///< If there is no class for this \a key, an exception is thrown.
|
||||||
|
|
||||||
|
|
|
@ -1605,13 +1605,17 @@ namespace MWWorld
|
||||||
if(!ptr.getClass().isActor())
|
if(!ptr.getClass().isActor())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (ptr.getClass().getCreatureStats(ptr).isDead())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (ptr.getClass().isFlying(ptr))
|
||||||
|
return true;
|
||||||
|
|
||||||
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
||||||
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).mMagnitude > 0
|
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).mMagnitude > 0
|
||||||
&& isLevitationEnabled())
|
&& isLevitationEnabled())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// TODO: Check if flying creature
|
|
||||||
|
|
||||||
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(ptr.getRefData().getHandle());
|
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(ptr.getRefData().getHandle());
|
||||||
if(!actor || !actor->getCollisionMode())
|
if(!actor || !actor->getCollisionMode())
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue