mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 22:45:33 +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())
|
||||
&& (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…
Reference in a new issue