mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04: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
@ -74,6 +74,7 @@
|
|||||||
Bug #5703: OpenMW-CS menu system crashing on XFCE
|
Bug #5703: OpenMW-CS menu system crashing on XFCE
|
||||||
Bug #5706: AI sequences stop looping after the saved game is reloaded
|
Bug #5706: AI sequences stop looping after the saved game is reloaded
|
||||||
Bug #5731: Editor: skirts are invisible on characters
|
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 #390: 3rd person look "over the shoulder"
|
||||||
Feature #1536: Show more information about level on menu
|
Feature #1536: Show more information about level on menu
|
||||||
Feature #2386: Distant Statics in the form of Object Paging
|
Feature #2386: Distant Statics in the form of Object Paging
|
||||||
|
@ -519,7 +519,7 @@ namespace MWBase
|
|||||||
/// Returns true if levitation spell effect is allowed.
|
/// Returns true if levitation spell effect is allowed.
|
||||||
virtual bool isLevitationEnabled() const = 0;
|
virtual bool isLevitationEnabled() const = 0;
|
||||||
|
|
||||||
virtual bool getGodModeState() = 0;
|
virtual bool getGodModeState() const = 0;
|
||||||
|
|
||||||
virtual bool toggleGodMode() = 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))
|
if (mFloatToSurface && cls.isActor() && cls.canSwim(mPtr))
|
||||||
|
{
|
||||||
|
if (cls.getCreatureStats(mPtr).isDead()
|
||||||
|
|| (!godmode && cls.getCreatureStats(mPtr).isParalyzed()))
|
||||||
|
{
|
||||||
moved.z() = 1.0;
|
moved.z() = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update movement
|
// Update movement
|
||||||
if(!animationOnly && mMovementAnimationControlled && mPtr.getClass().isActor())
|
if(!animationOnly && mMovementAnimationControlled && mPtr.getClass().isActor())
|
||||||
|
@ -130,8 +130,9 @@ namespace MWPhysics
|
|||||||
velocity = velocity + inertia;
|
velocity = velocity + inertia;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dead actors underwater will float to the surface, if the CharacterController tells us to do so
|
// Dead and paralyzed actors underwater will float to the surface,
|
||||||
if (actor.mMovement.z() > 0 && actor.mIsDead && actor.mPosition.z() < swimlevel)
|
// 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;
|
velocity = osg::Vec3f(0,0,1) * 25;
|
||||||
|
|
||||||
if (actor.mWantJump)
|
if (actor.mWantJump)
|
||||||
|
@ -922,7 +922,9 @@ namespace MWPhysics
|
|||||||
mFlying = world->isFlying(ptr);
|
mFlying = world->isFlying(ptr);
|
||||||
mSwimming = world->isSwimming(ptr);
|
mSwimming = world->isSwimming(ptr);
|
||||||
mWantJump = ptr.getClass().getMovementSettings(ptr).mPosition[2] != 0;
|
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();
|
mWasOnGround = actor->getOnGround();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ namespace MWPhysics
|
|||||||
bool mWasOnGround;
|
bool mWasOnGround;
|
||||||
bool mWantJump;
|
bool mWantJump;
|
||||||
bool mDidJump;
|
bool mDidJump;
|
||||||
bool mIsDead;
|
bool mFloatToSurface;
|
||||||
bool mNeedLand;
|
bool mNeedLand;
|
||||||
bool mMoveToWaterSurface;
|
bool mMoveToWaterSurface;
|
||||||
float mWaterlevel;
|
float mWaterlevel;
|
||||||
|
@ -2302,8 +2302,12 @@ namespace MWWorld
|
|||||||
if (stats.isDead())
|
if (stats.isDead())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
const bool isPlayer = ptr == getPlayerConstPtr();
|
||||||
|
if (!(isPlayer && mGodMode) && stats.isParalyzed())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (ptr.getClass().canFly(ptr))
|
if (ptr.getClass().canFly(ptr))
|
||||||
return !stats.isParalyzed();
|
return true;
|
||||||
|
|
||||||
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).getMagnitude() > 0
|
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).getMagnitude() > 0
|
||||||
&& isLevitationEnabled())
|
&& isLevitationEnabled())
|
||||||
@ -2913,7 +2917,7 @@ namespace MWWorld
|
|||||||
mRendering->rebuildPtr(getPlayerPtr());
|
mRendering->rebuildPtr(getPlayerPtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool World::getGodModeState()
|
bool World::getGodModeState() const
|
||||||
{
|
{
|
||||||
return mGodMode;
|
return mGodMode;
|
||||||
}
|
}
|
||||||
|
@ -619,7 +619,7 @@ namespace MWWorld
|
|||||||
/// Returns true if levitation spell effect is allowed.
|
/// Returns true if levitation spell effect is allowed.
|
||||||
bool isLevitationEnabled() const override;
|
bool isLevitationEnabled() const override;
|
||||||
|
|
||||||
bool getGodModeState() override;
|
bool getGodModeState() const override;
|
||||||
|
|
||||||
bool toggleGodMode() override;
|
bool toggleGodMode() override;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user