mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 17:39:40 +00:00
Merge branch 'paralyze' into 'master'
Fix paralyze for swimming and levitating actors Closes #5758 See merge request OpenMW/openmw!488
This commit is contained in:
commit
4f1361b5ea
8 changed files with 24 additions and 10 deletions
|
@ -74,6 +74,7 @@
|
|||
Bug #5703: OpenMW-CS menu system crashing on XFCE
|
||||
Bug #5706: AI sequences stop looping after the saved game is reloaded
|
||||
Bug #5731: Editor: skirts are invisible on characters
|
||||
Bug #5758: Paralyzed actors behavior is inconsistent with vanilla
|
||||
Feature #390: 3rd person look "over the shoulder"
|
||||
Feature #1536: Show more information about level on menu
|
||||
Feature #2386: Distant Statics in the form of Object Paging
|
||||
|
|
|
@ -519,7 +519,7 @@ namespace MWBase
|
|||
/// Returns true if levitation spell effect is allowed.
|
||||
virtual bool isLevitationEnabled() const = 0;
|
||||
|
||||
virtual bool getGodModeState() = 0;
|
||||
virtual bool getGodModeState() const = 0;
|
||||
|
||||
virtual bool toggleGodMode() = 0;
|
||||
|
||||
|
|
|
@ -2439,8 +2439,14 @@ void CharacterController::update(float duration, bool animationOnly)
|
|||
}
|
||||
}
|
||||
|
||||
if (mFloatToSurface && cls.isActor() && cls.getCreatureStats(mPtr).isDead() && cls.canSwim(mPtr))
|
||||
moved.z() = 1.0;
|
||||
if (mFloatToSurface && cls.isActor() && cls.canSwim(mPtr))
|
||||
{
|
||||
if (cls.getCreatureStats(mPtr).isDead()
|
||||
|| (!godmode && cls.getCreatureStats(mPtr).isParalyzed()))
|
||||
{
|
||||
moved.z() = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
// Update movement
|
||||
if(!animationOnly && mMovementAnimationControlled && mPtr.getClass().isActor())
|
||||
|
|
|
@ -130,8 +130,9 @@ namespace MWPhysics
|
|||
velocity = velocity + inertia;
|
||||
}
|
||||
|
||||
// dead actors underwater will float to the surface, if the CharacterController tells us to do so
|
||||
if (actor.mMovement.z() > 0 && actor.mIsDead && actor.mPosition.z() < swimlevel)
|
||||
// Dead and paralyzed actors underwater will float to the surface,
|
||||
// if the CharacterController tells us to do so
|
||||
if (actor.mMovement.z() > 0 && actor.mFloatToSurface && actor.mPosition.z() < swimlevel)
|
||||
velocity = osg::Vec3f(0,0,1) * 25;
|
||||
|
||||
if (actor.mWantJump)
|
||||
|
|
|
@ -922,7 +922,9 @@ namespace MWPhysics
|
|||
mFlying = world->isFlying(ptr);
|
||||
mSwimming = world->isSwimming(ptr);
|
||||
mWantJump = ptr.getClass().getMovementSettings(ptr).mPosition[2] != 0;
|
||||
mIsDead = ptr.getClass().getCreatureStats(ptr).isDead();
|
||||
auto& stats = ptr.getClass().getCreatureStats(ptr);
|
||||
const bool godmode = ptr == world->getPlayerConstPtr() && world->getGodModeState();
|
||||
mFloatToSurface = stats.isDead() || (!godmode && stats.isParalyzed());
|
||||
mWasOnGround = actor->getOnGround();
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace MWPhysics
|
|||
bool mWasOnGround;
|
||||
bool mWantJump;
|
||||
bool mDidJump;
|
||||
bool mIsDead;
|
||||
bool mFloatToSurface;
|
||||
bool mNeedLand;
|
||||
bool mMoveToWaterSurface;
|
||||
float mWaterlevel;
|
||||
|
|
|
@ -2302,8 +2302,12 @@ namespace MWWorld
|
|||
if (stats.isDead())
|
||||
return false;
|
||||
|
||||
const bool isPlayer = ptr == getPlayerConstPtr();
|
||||
if (!(isPlayer && mGodMode) && stats.isParalyzed())
|
||||
return false;
|
||||
|
||||
if (ptr.getClass().canFly(ptr))
|
||||
return !stats.isParalyzed();
|
||||
return true;
|
||||
|
||||
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).getMagnitude() > 0
|
||||
&& isLevitationEnabled())
|
||||
|
@ -2913,7 +2917,7 @@ namespace MWWorld
|
|||
mRendering->rebuildPtr(getPlayerPtr());
|
||||
}
|
||||
|
||||
bool World::getGodModeState()
|
||||
bool World::getGodModeState() const
|
||||
{
|
||||
return mGodMode;
|
||||
}
|
||||
|
|
|
@ -619,7 +619,7 @@ namespace MWWorld
|
|||
/// Returns true if levitation spell effect is allowed.
|
||||
bool isLevitationEnabled() const override;
|
||||
|
||||
bool getGodModeState() override;
|
||||
bool getGodModeState() const override;
|
||||
|
||||
bool toggleGodMode() override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue