Merge remote-tracking branch 'scrawl/master'

deque
Marc Zinnschlag 10 years ago
commit 352cbf26c6

@ -77,12 +77,12 @@ opencs_units (view/widget
opencs_units (view/render opencs_units (view/render
scenewidget worldspacewidget pagedworldspacewidget unpagedworldspacewidget scenewidget worldspacewidget pagedworldspacewidget unpagedworldspacewidget
previewwidget terrainstorage previewwidget
) )
opencs_units_noqt (view/render opencs_units_noqt (view/render
navigation navigation1st navigationfree navigationorbit lighting lightingday lightingnight navigation navigation1st navigationfree navigationorbit lighting lightingday lightingnight
lightingbright object cell lightingbright object cell terrainstorage
) )
opencs_hdrs_noqt (view/render opencs_hdrs_noqt (view/render

@ -166,10 +166,18 @@ namespace MWMechanics
{ {
const CreatureStats& stats = actor.getClass().getCreatureStats(actor); const CreatureStats& stats = actor.getClass().getCreatureStats(actor);
// Never casting racial spells (ST_Power and F_Always) if (spell->mData.mType != ESM::Spell::ST_Spell)
if (spell->mData.mType != ESM::Spell::ST_Spell || spell->mData.mFlags & ESM::Spell::F_Always)
return 0.f; return 0.f;
// Don't make use of racial bonus spells, like MW. Can be made optional later
if (actor.getClass().isNpc())
{
std::string raceid = actor.get<ESM::NPC>()->mBase->mRace;
const ESM::Race* race = MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(raceid);
if (race->mPowers.exists(spell->mId))
return 0.f;
}
if (spell->mData.mCost > stats.getMagicka().getCurrent()) if (spell->mData.mCost > stats.getMagicka().getCurrent())
return 0.f; return 0.f;

@ -292,6 +292,7 @@ namespace MWMechanics
, mTarget(target) , mTarget(target)
, mStack(false) , mStack(false)
, mHitPosition(0,0,0) , mHitPosition(0,0,0)
, mAlwaysSucceed(false)
{ {
} }
@ -761,7 +762,7 @@ namespace MWMechanics
int school = 0; int school = 0;
if (mCaster.getClass().isActor()) if (mCaster.getClass().isActor() && !mAlwaysSucceed)
{ {
school = getSpellSchool(spell, mCaster); school = getSpellSchool(spell, mCaster);

@ -68,6 +68,7 @@ namespace MWMechanics
std::string mId; // ID of spell, potion, item etc std::string mId; // ID of spell, potion, item etc
std::string mSourceName; // Display name for spell, potion, etc std::string mSourceName; // Display name for spell, potion, etc
Ogre::Vector3 mHitPosition; // Used for spawning area orb Ogre::Vector3 mHitPosition; // Used for spawning area orb
bool mAlwaysSucceed; // Always succeed spells casted by NPCs/creatures regardless of their chance (default: false)
public: public:
CastSpell(const MWWorld::Ptr& caster, const MWWorld::Ptr& target); CastSpell(const MWWorld::Ptr& caster, const MWWorld::Ptr& target);

@ -854,6 +854,7 @@ namespace MWScript
MWMechanics::CastSpell cast(ptr, target); MWMechanics::CastSpell cast(ptr, target);
cast.mHitPosition = Ogre::Vector3(target.getRefData().getPosition().pos); cast.mHitPosition = Ogre::Vector3(target.getRefData().getPosition().pos);
cast.mAlwaysSucceed = true;
cast.cast(spell); cast.cast(spell);
} }
}; };
@ -871,6 +872,7 @@ namespace MWScript
MWMechanics::CastSpell cast(ptr, ptr); MWMechanics::CastSpell cast(ptr, ptr);
cast.mHitPosition = Ogre::Vector3(ptr.getRefData().getPosition().pos); cast.mHitPosition = Ogre::Vector3(ptr.getRefData().getPosition().pos);
cast.mAlwaysSucceed = true;
cast.cast(spell); cast.cast(spell);
} }
}; };

@ -454,6 +454,7 @@ namespace MWSound
while(snditer != mActiveSounds.end()) while(snditer != mActiveSounds.end())
{ {
if(snditer->second.first != MWWorld::Ptr() && if(snditer->second.first != MWWorld::Ptr() &&
snditer->second.first.getCellRef().getRefId() != "player" &&
snditer->second.first.getCell() == cell) snditer->second.first.getCell() == cell)
{ {
snditer->first->stop(); snditer->first->stop();

Loading…
Cancel
Save