Don't allow resting as a werewolf

actorid
Chris Robinson 12 years ago
parent 75131e6a48
commit 6110a0ee3b

@ -223,10 +223,14 @@ namespace MWGui
bool full = (stats.getFatigue().getCurrent() >= stats.getFatigue().getModified())
&& (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
MWMechanics::NpcStats& npcstats = MWWorld::Class::get(player).getNpcStats(player);
bool werewolf = npcstats.isWerewolf();
mUntilHealedButton->setVisible(canRest && !full);
mWaitButton->setCaptionWithReplacing (canRest ? "#{sRest}" : "#{sWait}");
mRestText->setCaptionWithReplacing (canRest ? "#{sRestMenu3}" : "#{sRestIllegal}");
mRestText->setCaptionWithReplacing (canRest ? "#{sRestMenu3}"
: (werewolf ? "#{sWerewolfRestMessage}"
: "#{sRestIllegal}"));
mSleeping = canRest;

@ -1645,13 +1645,15 @@ namespace MWWorld
{
Ptr::CellStore *currentCell = mWorldScene->getCurrentCell();
RefData &refdata = mPlayer->getPlayer().getRefData();
Ptr player = mPlayer->getPlayer();
RefData &refdata = player.getRefData();
Ogre::Vector3 playerPos(refdata.getPosition().pos);
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos))
return 2;
if((currentCell->mCell->mData.mFlags&ESM::Cell::NoSleep))
if((currentCell->mCell->mData.mFlags&ESM::Cell::NoSleep) ||
Class::get(player).getNpcStats(player).isWerewolf())
return 1;
return 0;

Loading…
Cancel
Save