Nothing to see here, move along.

Fine... it's flying cliff racers. But did you really want to know?
actorid
scrawl 11 years ago
parent 44e96fcaaa
commit ce013315ba

@ -413,6 +413,14 @@ namespace MWClass
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)
{
if(name == "left")

@ -99,6 +99,8 @@ namespace MWClass
isActor() const {
return true;
}
virtual bool isFlying (const MWWorld::Ptr &ptr) const;
};
}

@ -372,4 +372,10 @@ namespace MWWorld
return newPtr;
}
bool Class::isFlying(const Ptr &ptr) const
{
return false;
}
}

@ -306,6 +306,8 @@ namespace MWWorld
return false;
}
virtual bool isFlying(const MWWorld::Ptr& ptr) const;
static const Class& get (const std::string& key);
///< If there is no class for this \a key, an exception is thrown.

@ -1605,13 +1605,17 @@ namespace MWWorld
if(!ptr.getClass().isActor())
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);
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).mMagnitude > 0
&& isLevitationEnabled())
return true;
// TODO: Check if flying creature
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(ptr.getRefData().getHandle());
if(!actor || !actor->getCollisionMode())
return true;

Loading…
Cancel
Save