diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 209229efc5..21029b6605 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -842,28 +842,7 @@ std::string CharacterController::chooseRandomAttackAnimation() const CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Animation *anim) : mPtr(ptr) - , mWeapon(MWWorld::Ptr()) , mAnimation(anim) - , mIdleState(CharState_None) - , mMovementState(CharState_None) - , mMovementAnimSpeed(0.f) - , mAdjustMovementAnimSpeed(false) - , mHasMovedInXY(false) - , mMovementAnimationControlled(true) - , mDeathState(CharState_None) - , mFloatToSurface(true) - , mHitState(CharState_None) - , mUpperBodyState(UpperCharState_Nothing) - , mJumpState(JumpState_None) - , mWeaponType(ESM::Weapon::None) - , mAttackStrength(0.f) - , mSkipAnim(false) - , mSecondsOfSwimming(0) - , mSecondsOfRunning(0) - , mTurnAnimationThreshold(0) - , mCastingManualSpell(false) - , mTimeUntilWake(0.f) - , mIsMovingBackward(false) { if(!mAnimation) return; diff --git a/apps/openmw/mwmechanics/character.hpp b/apps/openmw/mwmechanics/character.hpp index 38f7a48a2b..2f50f56c58 100644 --- a/apps/openmw/mwmechanics/character.hpp +++ b/apps/openmw/mwmechanics/character.hpp @@ -149,50 +149,50 @@ class CharacterController : public MWRender::Animation::TextKeyListener typedef std::deque AnimationQueue; AnimationQueue mAnimQueue; - CharacterState mIdleState; + CharacterState mIdleState{CharState_None}; std::string mCurrentIdle; - CharacterState mMovementState; + CharacterState mMovementState{CharState_None}; std::string mCurrentMovement; - float mMovementAnimSpeed; - bool mAdjustMovementAnimSpeed; - bool mHasMovedInXY; - bool mMovementAnimationControlled; + float mMovementAnimSpeed{0.f}; + bool mAdjustMovementAnimSpeed{false}; + bool mHasMovedInXY{false}; + bool mMovementAnimationControlled{true}; - CharacterState mDeathState; + CharacterState mDeathState{CharState_None}; std::string mCurrentDeath; - bool mFloatToSurface; + bool mFloatToSurface{true}; - CharacterState mHitState; + CharacterState mHitState{CharState_None}; std::string mCurrentHit; - UpperBodyCharacterState mUpperBodyState; + UpperBodyCharacterState mUpperBodyState{UpperCharState_Nothing}; - JumpingState mJumpState; + JumpingState mJumpState{JumpState_None}; std::string mCurrentJump; - int mWeaponType; + int mWeaponType{ESM::Weapon::None}; std::string mCurrentWeapon; - float mAttackStrength; + float mAttackStrength{0.f}; - bool mSkipAnim; + bool mSkipAnim{false}; // counted for skill increase - float mSecondsOfSwimming; - float mSecondsOfRunning; + float mSecondsOfSwimming{0.f}; + float mSecondsOfRunning{0.f}; MWWorld::ConstPtr mHeadTrackTarget; - float mTurnAnimationThreshold; // how long to continue playing turning animation after actor stopped turning + float mTurnAnimationThreshold{0.f}; // how long to continue playing turning animation after actor stopped turning std::string mAttackType; // slash, chop or thrust - bool mCastingManualSpell; + bool mCastingManualSpell{false}; - float mTimeUntilWake; + float mTimeUntilWake{0.f}; - bool mIsMovingBackward; + bool mIsMovingBackward{false}; osg::Vec2f mSmoothedSpeed; void setAttackTypeBasedOnMovement();