@@ -39,30 +39,30 @@ namespace MWMechanics
39
39
class CreatureStats
40
40
{
41
41
static int sActorId ;
42
- DrawState mDrawState ;
43
42
std::map<ESM::RefId, AttributeValue> mAttributes ;
44
43
DynamicStat<float > mDynamic [3 ]; // health, magicka, fatigue
44
+ DrawState mDrawState = DrawState::Nothing;
45
45
Spells mSpells ;
46
46
ActiveSpells mActiveSpells ;
47
47
MagicEffects mMagicEffects ;
48
48
Stat<int > mAiSettings [4 ];
49
49
AiSequence mAiSequence ;
50
- bool mDead ;
51
- bool mDeathAnimationFinished ;
52
- bool mDied ; // flag for OnDeath script function
53
- bool mMurdered ;
54
- int mFriendlyHits ;
55
- bool mTalkedTo ;
56
- bool mAlarmed ;
57
- bool mAttacked ;
58
- bool mKnockdown ;
59
- bool mKnockdownOneFrame ;
60
- bool mKnockdownOverOneFrame ;
61
- bool mHitRecovery ;
62
- bool mBlock ;
63
- unsigned int mMovementFlags ;
64
-
65
- float mFallHeight ;
50
+ bool mDead = false ;
51
+ bool mDeathAnimationFinished = false ;
52
+ bool mDied = false ; // flag for OnDeath script function
53
+ bool mMurdered = false ;
54
+ int mFriendlyHits = 0 ;
55
+ bool mTalkedTo = false ;
56
+ bool mAlarmed = false ;
57
+ bool mAttacked = false ;
58
+ bool mKnockdown = false ;
59
+ bool mKnockdownOneFrame = false ;
60
+ bool mKnockdownOverOneFrame = false ;
61
+ bool mHitRecovery = false ;
62
+ bool mBlock = false ;
63
+ unsigned int mMovementFlags = 0 ;
64
+
65
+ float mFallHeight = 0 .f ;
66
66
67
67
ESM::RefId mLastHitObject ; // The last object to hit this actor
68
68
ESM::RefId mLastHitAttemptObject ; // The last object to attempt to hit this actor
@@ -71,21 +71,17 @@ namespace MWMechanics
71
71
MWWorld::TimeStamp mLastRestock ;
72
72
73
73
// The pool of merchant gold (not in inventory)
74
- int mGoldPool ;
74
+ int mGoldPool = 0 ;
75
75
76
- int mActorId ;
77
- int mHitAttemptActorId ; // Stores an actor that attacked this actor. Only one is stored at a time,
78
- // and it is not changed if a different actor attacks. It is cleared when combat ends.
79
-
80
- // The index of the death animation that was played, or -1 if none played
81
- signed char mDeathAnimation ;
82
-
83
- MWWorld::TimeStamp mTimeOfDeath ;
76
+ int mActorId = -1 ;
77
+ // Stores an actor that attacked this actor. Only one is stored at a time, and it is not changed if a different
78
+ // actor attacks. It is cleared when combat ends.
79
+ int mHitAttemptActorId = -1 ;
84
80
85
81
// The difference between view direction and lower body direction.
86
- float mSideMovementAngle ;
82
+ float mSideMovementAngle = 0 ;
87
83
88
- bool mTeleported = false ;
84
+ MWWorld::TimeStamp mTimeOfDeath ;
89
85
90
86
private:
91
87
std::multimap<int , int > mSummonedCreatures ; // <Effect, ActorId>
@@ -95,9 +91,15 @@ namespace MWMechanics
95
91
std::vector<int > mSummonGraveyard ;
96
92
97
93
protected:
98
- int mLevel ;
99
- bool mAttackingOrSpell ;
100
94
std::string mAttackType ;
95
+ int mLevel = 0 ;
96
+ bool mAttackingOrSpell = false ;
97
+
98
+ private:
99
+ // The index of the death animation that was played, or -1 if none played
100
+ signed char mDeathAnimation = -1 ;
101
+
102
+ bool mTeleported = false ;
101
103
102
104
public:
103
105
CreatureStats ();
0 commit comments