mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Merge pull request #2303 from Capostrophic/levitation
Fix certain levitation state inconsistencies (bug #4948)
This commit is contained in:
commit
4f6658bcb5
@ -52,6 +52,7 @@
|
|||||||
Bug #4922: Werewolves can not attack if the transformation happens during attack
|
Bug #4922: Werewolves can not attack if the transformation happens during attack
|
||||||
Bug #4938: Strings from subrecords with actually empty headers can't be empty
|
Bug #4938: Strings from subrecords with actually empty headers can't be empty
|
||||||
Bug #4942: Hand-to-Hand attack type is chosen randomly when "always use best attack" is turned off
|
Bug #4942: Hand-to-Hand attack type is chosen randomly when "always use best attack" is turned off
|
||||||
|
Bug #4948: Footstep sounds while levitating on ground level
|
||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
Feature #3442: Default values for fallbacks from ini file
|
Feature #3442: Default values for fallbacks from ini file
|
||||||
Feature #3610: Option to invert X axis
|
Feature #3610: Option to invert X axis
|
||||||
|
@ -459,8 +459,9 @@ namespace MWBase
|
|||||||
{
|
{
|
||||||
Rest_Allowed = 0,
|
Rest_Allowed = 0,
|
||||||
Rest_OnlyWaiting = 1,
|
Rest_OnlyWaiting = 1,
|
||||||
Rest_PlayerIsUnderwater = 2,
|
Rest_PlayerIsInAir = 2,
|
||||||
Rest_EnemiesAreNearby = 3
|
Rest_PlayerIsUnderwater = 3,
|
||||||
|
Rest_EnemiesAreNearby = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/// check if the player is allowed to rest
|
/// check if the player is allowed to rest
|
||||||
|
@ -706,6 +706,8 @@ namespace MWClass
|
|||||||
if(name == "left")
|
if(name == "left")
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
if(world->isFlying(ptr))
|
||||||
|
return -1;
|
||||||
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
||||||
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
||||||
return ESM::SoundGenerator::SwimLeft;
|
return ESM::SoundGenerator::SwimLeft;
|
||||||
@ -716,6 +718,8 @@ namespace MWClass
|
|||||||
if(name == "right")
|
if(name == "right")
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
if(world->isFlying(ptr))
|
||||||
|
return -1;
|
||||||
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
||||||
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
||||||
return ESM::SoundGenerator::SwimRight;
|
return ESM::SoundGenerator::SwimRight;
|
||||||
|
@ -1214,6 +1214,8 @@ namespace MWClass
|
|||||||
if(name == "left" || name == "right")
|
if(name == "left" || name == "right")
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
if(world->isFlying(ptr))
|
||||||
|
return std::string();
|
||||||
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
||||||
if(world->isSwimming(ptr))
|
if(world->isSwimming(ptr))
|
||||||
return (name == "left") ? "Swim Left" : "Swim Right";
|
return (name == "left") ? "Swim Left" : "Swim Right";
|
||||||
|
@ -80,10 +80,17 @@ namespace MWGui
|
|||||||
mTimeAdvancer.eventInterrupted += MyGUI::newDelegate(this, &WaitDialog::onWaitingInterrupted);
|
mTimeAdvancer.eventInterrupted += MyGUI::newDelegate(this, &WaitDialog::onWaitingInterrupted);
|
||||||
mTimeAdvancer.eventFinished += MyGUI::newDelegate(this, &WaitDialog::onWaitingFinished);
|
mTimeAdvancer.eventFinished += MyGUI::newDelegate(this, &WaitDialog::onWaitingFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WaitDialog::onReferenceUnavailable ()
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Rest);
|
||||||
|
resetReference();
|
||||||
|
}
|
||||||
|
|
||||||
void WaitDialog::setPtr(const MWWorld::Ptr &ptr)
|
void WaitDialog::setPtr(const MWWorld::Ptr &ptr)
|
||||||
{
|
{
|
||||||
setCanRest(!ptr.isEmpty() || MWBase::Environment::get().getWorld ()->canRest () == MWBase::World::Rest_Allowed);
|
mPtr = ptr;
|
||||||
|
setCanRest(!mPtr.isEmpty() || MWBase::Environment::get().getWorld ()->canRest () == MWBase::World::Rest_Allowed);
|
||||||
|
|
||||||
if (mUntilHealedButton->getVisible())
|
if (mUntilHealedButton->getVisible())
|
||||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mUntilHealedButton);
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mUntilHealedButton);
|
||||||
@ -100,6 +107,7 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
mSleeping = false;
|
mSleeping = false;
|
||||||
mTimeAdvancer.stop();
|
mTimeAdvancer.stop();
|
||||||
|
resetReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaitDialog::onOpen()
|
void WaitDialog::onOpen()
|
||||||
@ -129,7 +137,13 @@ namespace MWGui
|
|||||||
}
|
}
|
||||||
else if (canRest == MWBase::World::Rest_PlayerIsUnderwater)
|
else if (canRest == MWBase::World::Rest_PlayerIsUnderwater)
|
||||||
{
|
{
|
||||||
// resting underwater or mid-air not allowed
|
// resting underwater not allowed
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
|
||||||
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
||||||
|
}
|
||||||
|
else if (mPtr.isEmpty() && canRest == MWBase::World::Rest_PlayerIsInAir)
|
||||||
|
{
|
||||||
|
// Resting in air is not allowed either, unless you're using a bed
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
||||||
}
|
}
|
||||||
@ -289,6 +303,8 @@ namespace MWGui
|
|||||||
|
|
||||||
void WaitDialog::onFrame(float dt)
|
void WaitDialog::onFrame(float dt)
|
||||||
{
|
{
|
||||||
|
checkReferenceAvailable();
|
||||||
|
|
||||||
mTimeAdvancer.onFrame(dt);
|
mTimeAdvancer.onFrame(dt);
|
||||||
|
|
||||||
if (mFadeTimeRemaining <= 0)
|
if (mFadeTimeRemaining <= 0)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "timeadvancer.hpp"
|
#include "timeadvancer.hpp"
|
||||||
|
|
||||||
#include "windowbase.hpp"
|
#include "windowbase.hpp"
|
||||||
|
#include "referenceinterface.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
@ -22,7 +23,7 @@ namespace MWGui
|
|||||||
MyGUI::TextBox* mProgressText;
|
MyGUI::TextBox* mProgressText;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WaitDialog : public WindowBase
|
class WaitDialog : public WindowBase, public ReferenceInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaitDialog();
|
WaitDialog();
|
||||||
@ -63,6 +64,8 @@ namespace MWGui
|
|||||||
|
|
||||||
WaitDialogProgressBar mProgressBar;
|
WaitDialogProgressBar mProgressBar;
|
||||||
|
|
||||||
|
virtual void onReferenceUnavailable();
|
||||||
|
|
||||||
void onUntilHealedButtonClicked(MyGUI::Widget* sender);
|
void onUntilHealedButtonClicked(MyGUI::Widget* sender);
|
||||||
void onWaitButtonClicked(MyGUI::Widget* sender);
|
void onWaitButtonClicked(MyGUI::Widget* sender);
|
||||||
void onCancelButtonClicked(MyGUI::Widget* sender);
|
void onCancelButtonClicked(MyGUI::Widget* sender);
|
||||||
|
@ -2477,9 +2477,12 @@ namespace MWWorld
|
|||||||
if(mPlayer->enemiesNearby())
|
if(mPlayer->enemiesNearby())
|
||||||
return Rest_EnemiesAreNearby;
|
return Rest_EnemiesAreNearby;
|
||||||
|
|
||||||
if ((actor->getCollisionMode() && !mPhysics->isOnSolidGround(player)) || isUnderwater(currentCell, playerPos) || isWalkingOnWater(player))
|
if (isUnderwater(currentCell, playerPos) || isWalkingOnWater(player))
|
||||||
return Rest_PlayerIsUnderwater;
|
return Rest_PlayerIsUnderwater;
|
||||||
|
|
||||||
|
if ((actor->getCollisionMode() && !mPhysics->isOnSolidGround(player)) || isFlying(player))
|
||||||
|
return Rest_PlayerIsInAir;
|
||||||
|
|
||||||
if((currentCell->getCell()->mData.mFlags&ESM::Cell::NoSleep) || player.getClass().getNpcStats(player).isWerewolf())
|
if((currentCell->getCell()->mData.mFlags&ESM::Cell::NoSleep) || player.getClass().getNpcStats(player).isWerewolf())
|
||||||
return Rest_OnlyWaiting;
|
return Rest_OnlyWaiting;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user