mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-29 21:41:31 +00:00
Don't allow resting as a werewolf
This commit is contained in:
parent
75131e6a48
commit
6110a0ee3b
2 changed files with 9 additions and 3 deletions
|
@ -223,10 +223,14 @@ namespace MWGui
|
||||||
bool full = (stats.getFatigue().getCurrent() >= stats.getFatigue().getModified())
|
bool full = (stats.getFatigue().getCurrent() >= stats.getFatigue().getModified())
|
||||||
&& (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
|
&& (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
|
||||||
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
|
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
|
||||||
|
MWMechanics::NpcStats& npcstats = MWWorld::Class::get(player).getNpcStats(player);
|
||||||
|
bool werewolf = npcstats.isWerewolf();
|
||||||
|
|
||||||
mUntilHealedButton->setVisible(canRest && !full);
|
mUntilHealedButton->setVisible(canRest && !full);
|
||||||
mWaitButton->setCaptionWithReplacing (canRest ? "#{sRest}" : "#{sWait}");
|
mWaitButton->setCaptionWithReplacing (canRest ? "#{sRest}" : "#{sWait}");
|
||||||
mRestText->setCaptionWithReplacing (canRest ? "#{sRestMenu3}" : "#{sRestIllegal}");
|
mRestText->setCaptionWithReplacing (canRest ? "#{sRestMenu3}"
|
||||||
|
: (werewolf ? "#{sWerewolfRestMessage}"
|
||||||
|
: "#{sRestIllegal}"));
|
||||||
|
|
||||||
mSleeping = canRest;
|
mSleeping = canRest;
|
||||||
|
|
||||||
|
|
|
@ -1645,13 +1645,15 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
Ptr::CellStore *currentCell = mWorldScene->getCurrentCell();
|
Ptr::CellStore *currentCell = mWorldScene->getCurrentCell();
|
||||||
|
|
||||||
RefData &refdata = mPlayer->getPlayer().getRefData();
|
Ptr player = mPlayer->getPlayer();
|
||||||
|
RefData &refdata = player.getRefData();
|
||||||
Ogre::Vector3 playerPos(refdata.getPosition().pos);
|
Ogre::Vector3 playerPos(refdata.getPosition().pos);
|
||||||
|
|
||||||
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
|
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
|
||||||
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos))
|
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos))
|
||||||
return 2;
|
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 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue