Skip to content

Commit 5095886

Browse files
committed
prone is now prone, crouch is now crouch, CanRun, other improvements
1 parent 97df2ef commit 5095886

File tree

8 files changed

+83
-59
lines changed

8 files changed

+83
-59
lines changed

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
New `Actor` Lua property `JumpHeight` (R) to estimate the jump height of the actor (in metres), based on the actor's jetpack and weight. Actors without a jetpack return 0.
1717
The new function `GetPathFindingFlyingJumpHeight()` can be used to get a jumpHeight that allows flying (i.e infinite jump height). This is also the value that `ACRocket`s and `ACDropships` return for `JumpHeight`.
1818

19-
- Improved Locomotion.
19+
- Improved locomotion.
2020
Added the ability to run. When running, you cannot sharpaim whatsoever.
21-
Added the ability to manually crouch. When crouching, your sharpaim distance is sligtly increased.
21+
Added the ability to manually crouch. When crouching, your sharpaim distance is slightly increased.
2222
Players on PC can enable running by holding the shift key, or crouch by holding control. Players using the arrow keys can use right ctrl/shift. Controllers can run by clicking in the left stick, or crouch by holding the left stick down. Prone on controllers is now performed by clicking in the right stick. SNES/d-pad controllers run using the right bumper.
23-
Added new `MovementState` type `RUN` for script.
24-
Added new `Controller` state `WALKCROUCH` for crouching, and `PRONE` for prone. The existing `CROUCH` state has been deprecated, as it referred to PRONE.
23+
Prone input now immediately throws you to the ground instead of crouching first.
24+
Added new `MovementState` type `RUN` for scripts.
25+
Added new `Controller` state `WALKCROUCH` for crouching, and `PRONE` for prone. The existing `CROUCH` state has been deprecated, as it referred to PRONE.
26+
Added new `Actor` INI and Lua (R/W) property `CanRun` which denotes whether the Actor can run or not.
2527

2628
- New music system, including a dynamic horizontal sequencing system, under the new music manager `MusicMan`.
2729
`PlayDynamicSong(string songName, string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to play a new DynamicSong.
@@ -90,6 +92,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
9092

9193
- The Signal Hunt activity no longer has a preview image, as it was not formatted correctly and spoiled the interior structure of the cave.
9294

95+
- Removed `AHUman` property MaxCrouchRotation. CrouchRotAngleTarget is now used.
96+
9397
</details>
9498

9599
## [Release v6.2.2] - 2024/02/24

Data/Imperatus.rte/Actors/Infantry/AllPurpose/AllPurposeRobot.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ AddActor = AHuman
525525
SharpAimDelay = 280
526526
Perceptiveness = 0.9
527527
CharHeight = 100
528+
CanRun = 0
528529
HolsterOffset = Vector
529530
X = -6
530531
Y = -4

Data/Imperatus.rte/Actors/Infantry/Combat/CombatRobot.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ AddActor = AHuman
483483
SharpAimDelay = 300
484484
Perceptiveness = 0.8
485485
CharHeight = 100
486+
CanRun = 0
486487
HolsterOffset = Vector
487488
X = -6
488489
Y = -10

Source/Entities/AHuman.cpp

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void AHuman::Clear() {
5555
m_ProneState = NOTPRONE;
5656
m_ProneTimer.Reset();
5757
m_MaxWalkPathCrouchShift = 6.0F;
58-
m_MaxCrouchRotation = c_QuarterPI * 0.85F;
58+
m_CrouchAmount = 0.0F;
5959
m_CrouchAmountOverride = -1.0F;
6060
for (int i = 0; i < MOVEMENTSTATECOUNT; ++i) {
6161
m_Paths[FGROUND][i].Reset();
@@ -64,6 +64,8 @@ void AHuman::Clear() {
6464
m_Paths[BGROUND][i].Terminate();
6565
m_RotAngleTargets[i] = 0.0F;
6666
}
67+
// Default CROUCH RotAngleTarget to a more sensible number
68+
m_RotAngleTargets[CROUCH] = c_QuarterPI * 0.85F;
6769
m_Aiming = false;
6870
m_ArmClimbing[FGROUND] = false;
6971
m_ArmClimbing[BGROUND] = false;
@@ -213,7 +215,6 @@ int AHuman::Create(const AHuman& reference) {
213215
m_BackupBGFootGroup->SetLimbPos(atomGroupToUseAsFootGroupBG->GetLimbPos());
214216

215217
m_MaxWalkPathCrouchShift = reference.m_MaxWalkPathCrouchShift;
216-
m_MaxCrouchRotation = reference.m_MaxCrouchRotation;
217218

218219
if (reference.m_StrideSound) {
219220
m_StrideSound = dynamic_cast<SoundContainer*>(reference.m_StrideSound->Clone());
@@ -293,7 +294,6 @@ int AHuman::ReadProperty(const std::string_view& propName, Reader& reader) {
293294
m_BackupBGFootGroup->RemoveAllAtoms();
294295
});
295296
MatchProperty("MaxWalkPathCrouchShift", { reader >> m_MaxWalkPathCrouchShift; });
296-
MatchProperty("MaxCrouchRotation", { reader >> m_MaxCrouchRotation; });
297297
MatchProperty("StrideSound", {
298298
m_StrideSound = new SoundContainer;
299299
reader >> m_StrideSound;
@@ -302,8 +302,8 @@ int AHuman::ReadProperty(const std::string_view& propName, Reader& reader) {
302302
MatchProperty("StandLimbPathBG", { reader >> m_Paths[BGROUND][STAND]; });
303303
MatchProperty("WalkLimbPath", { reader >> m_Paths[FGROUND][WALK]; });
304304
MatchProperty("RunLimbPath", { reader >> m_Paths[FGROUND][RUN]; });
305-
MatchProperty("CrouchLimbPath", { reader >> m_Paths[FGROUND][CROUCH]; });
306-
MatchProperty("CrouchLimbPathBG", { reader >> m_Paths[BGROUND][CROUCH]; });
305+
MatchProperty("CrouchLimbPath", { reader >> m_Paths[FGROUND][PRONE]; });
306+
MatchProperty("CrouchLimbPathBG", { reader >> m_Paths[BGROUND][PRONE]; });
307307
MatchProperty("CrawlLimbPath", { reader >> m_Paths[FGROUND][CRAWL]; });
308308
MatchProperty("ArmCrawlLimbPath", { reader >> m_Paths[FGROUND][ARMCRAWL]; });
309309
MatchProperty("ClimbLimbPath", { reader >> m_Paths[FGROUND][CLIMB]; });
@@ -353,8 +353,6 @@ int AHuman::Save(Writer& writer) const {
353353
writer << m_pBGFootGroup;
354354
writer.NewProperty("MaxWalkPathCrouchShift");
355355
writer << m_MaxWalkPathCrouchShift;
356-
writer.NewProperty("MaxCrouchRotation");
357-
writer << m_MaxCrouchRotation;
358356
writer.NewProperty("StrideSound");
359357
writer << m_StrideSound;
360358

@@ -367,7 +365,7 @@ int AHuman::Save(Writer& writer) const {
367365
writer.NewProperty("RunLimbPath");
368366
writer << m_Paths[FGROUND][RUN];
369367
writer.NewProperty("CrouchLimbPath");
370-
writer << m_Paths[FGROUND][CROUCH];
368+
writer << m_Paths[FGROUND][PRONE];
371369
writer.NewProperty("CrawlLimbPath");
372370
writer << m_Paths[FGROUND][CRAWL];
373371
writer.NewProperty("ArmCrawlLimbPath");
@@ -382,7 +380,7 @@ int AHuman::Save(Writer& writer) const {
382380
writer.NewPropertyWithValue("StandRotAngleTarget", m_RotAngleTargets[STAND]);
383381
writer.NewPropertyWithValue("WalkRotAngleTarget", m_RotAngleTargets[WALK]);
384382
writer.NewPropertyWithValue("RunRotAngleTarget", m_RotAngleTargets[RUN]);
385-
writer.NewPropertyWithValue("CrouchRotAngleTarget", m_RotAngleTargets[CROUCH]);
383+
writer.NewPropertyWithValue("CrouchRotAngleTarget", m_RotAngleTargets[PRONE]);
386384
writer.NewPropertyWithValue("JumpRotAngleTarget", m_RotAngleTargets[JUMP]);
387385

388386
return 0;
@@ -1438,12 +1436,19 @@ void AHuman::UpdateCrouching() {
14381436

14391437
float finalWalkPathYOffset = std::clamp(Lerp(0.0F, 1.0F, -m_WalkPathOffset.m_Y, desiredWalkPathYOffset, 0.3F), 0.0F, m_MaxWalkPathCrouchShift);
14401438
m_WalkPathOffset.m_Y = -finalWalkPathYOffset;
1439+
1440+
m_CrouchAmount = desiredWalkPathYOffset / m_MaxWalkPathCrouchShift;
14411441

14421442
// Adjust our X offset to try to keep our legs under our centre-of-mass
14431443
const float ratioBetweenBodyAndHeadToAimFor = 0.15F;
14441444
Vector headPos = m_pHead ? m_pHead->GetPos() : m_Pos;
14451445
float predictedPosition = ((headPos.m_X - m_Pos.m_X) * ratioBetweenBodyAndHeadToAimFor) + m_Vel.m_X;
14461446
m_WalkPathOffset.m_X = predictedPosition;
1447+
if (m_CrouchAmount > 0.9F && !m_MoveState == WALK ) {
1448+
// Let the CrouchLimbPath take over here
1449+
m_WalkPathOffset.m_Y = 0.0F;
1450+
m_WalkPathOffset.m_X = 0.0F;
1451+
}
14471452
}
14481453

14491454
void AHuman::UpdateLimbPathSpeed() {
@@ -1512,6 +1517,11 @@ void AHuman::PreControllerUpdate() {
15121517

15131518
if (!keepOldState) {
15141519
bool prone = m_Controller.IsState(BODY_PRONE);
1520+
// Engage prone state, this makes the body's rotational spring pull it horizontal instead of upright.
1521+
if (prone && m_ProneState == NOTPRONE) {
1522+
m_ProneState = GOPRONE;
1523+
m_ProneTimer.Reset();
1524+
}
15151525
if ((m_Controller.IsState(MOVE_RIGHT) || m_Controller.IsState(MOVE_LEFT) || m_MoveState == JUMP) && m_Status != INACTIVE) {
15161526
for (int i = WALK; i < MOVEMENTSTATECOUNT; ++i) {
15171527
m_Paths[FGROUND][i].SetHFlip(m_HFlipped);
@@ -1520,9 +1530,9 @@ void AHuman::PreControllerUpdate() {
15201530
// Only if not jumping, OR if jumping, and apparently stuck on something - then help out with the limbs.
15211531
if (m_MoveState != JUMP || isStill) {
15221532
MovementState oldMoveState = m_MoveState;
1523-
if (prone) {
1533+
if (!m_ProneState == NOTPRONE) {
15241534
m_MoveState = CRAWL;
1525-
} else if (m_Controller.IsState(MOVE_FAST) && !m_Controller.IsState(BODY_CROUCH)) {
1535+
} else if (m_CanRun && m_Controller.IsState(MOVE_FAST) && !m_Controller.IsState(BODY_CROUCH)) {
15261536
m_MoveState = RUN;
15271537
} else {
15281538
m_MoveState = WALK;
@@ -1533,12 +1543,6 @@ void AHuman::PreControllerUpdate() {
15331543
m_StrideStart = true;
15341544
MoveOutOfTerrain(g_MaterialGrass);
15351545
}
1536-
1537-
// Engage prone state, this makes the body's rotational spring pull it horizontal instead of upright.
1538-
if (m_MoveState == CRAWL && m_ProneState == NOTPRONE) {
1539-
m_ProneState = GOPRONE;
1540-
m_ProneTimer.Reset();
1541-
}
15421546
}
15431547

15441548
// Walk backwards if the aiming is already focused in the opposite direction of travel.
@@ -1562,15 +1566,18 @@ void AHuman::PreControllerUpdate() {
15621566
m_StrideStart = true;
15631567
// Stop the going prone spring.
15641568
if (m_ProneState == GOPRONE) {
1565-
m_ProneState = PRONE;
1569+
m_ProneState = LAYINGPRONE;
15661570
}
15671571
}
15681572
} else {
15691573
m_ArmClimbing[FGROUND] = false;
15701574
m_ArmClimbing[BGROUND] = false;
15711575
if (prone) {
15721576
// Don't go back to prone if we're already prone, the player has to let go of the crouch button first. If already laying down, just stay put.
1573-
m_MoveState = m_ProneState == NOTPRONE ? CROUCH : NOMOVE;
1577+
m_MoveState = m_ProneState == NOTPRONE ? PRONE : NOMOVE;
1578+
} else if (m_CrouchAmount > 0.9F) {
1579+
// Fully crouching will set the appropriate state so we can use CrouchLimbPath
1580+
m_MoveState = CROUCH;
15741581
} else {
15751582
m_MoveState = STAND;
15761583
}
@@ -1682,7 +1689,7 @@ void AHuman::PreControllerUpdate() {
16821689
m_StrideStart = true;
16831690
// Stop the going prone spring.
16841691
if (m_ProneState == GOPRONE) {
1685-
m_ProneState = PRONE;
1692+
m_ProneState = LAYINGPRONE;
16861693
}
16871694
}
16881695
// Correct angle based on flip.
@@ -1699,7 +1706,7 @@ void AHuman::PreControllerUpdate() {
16991706

17001707
// TODO: make the delay data driven by both the actor and the device!
17011708
//
1702-
if (isSharpAiming && m_Status == STABLE && (m_MoveState == STAND || m_MoveState == CROUCH || m_MoveState == NOMOVE || m_MoveState == WALK) && m_Vel.MagnitudeIsLessThan(5.0F) && GetEquippedItem()) {
1709+
if (isSharpAiming && m_Status == STABLE && (m_MoveState == STAND || m_MoveState == PRONE || m_MoveState == NOMOVE || m_MoveState == WALK) && m_Vel.MagnitudeIsLessThan(5.0F) && GetEquippedItem()) {
17031710
float aimMag = analogAim.GetMagnitude();
17041711

17051712
// If aim sharp is being done digitally, then translate to full analog aim mag
@@ -2119,7 +2126,7 @@ void AHuman::PreControllerUpdate() {
21192126
}
21202127
} else if (m_MoveState == CRAWL) {
21212128
// Start crawling only once we are fully prone.
2122-
if (m_ProneState == PRONE) {
2129+
if (m_ProneState == LAYINGPRONE) {
21232130

21242131
float FGLegProg = m_Paths[FGROUND][CRAWL].GetRegularProgress();
21252132
float BGLegProg = m_Paths[BGROUND][CRAWL].GetRegularProgress();
@@ -2184,11 +2191,11 @@ void AHuman::PreControllerUpdate() {
21842191
m_Paths[BGROUND][CRAWL].Terminate();
21852192

21862193
if (m_pFGLeg) {
2187-
m_pFGFootGroup->PushAsLimb(m_Pos.GetFloored() + m_pFGLeg->GetParentOffset().GetXFlipped(m_HFlipped), m_Vel, Matrix(), m_Paths[FGROUND][CROUCH], deltaTime);
2194+
m_pFGFootGroup->PushAsLimb(m_Pos.GetFloored() + m_pFGLeg->GetParentOffset().GetXFlipped(m_HFlipped), m_Vel, Matrix(), m_Paths[FGROUND][PRONE], deltaTime);
21882195
}
21892196

21902197
if (m_pBGLeg) {
2191-
m_pBGFootGroup->PushAsLimb(m_Pos.GetFloored() + m_pBGLeg->GetParentOffset().GetXFlipped(m_HFlipped), m_Vel, Matrix(), m_Paths[BGROUND][CROUCH], deltaTime);
2198+
m_pBGFootGroup->PushAsLimb(m_Pos.GetFloored() + m_pBGLeg->GetParentOffset().GetXFlipped(m_HFlipped), m_Vel, Matrix(), m_Paths[BGROUND][PRONE], deltaTime);
21922199
}
21932200

21942201
} else {
@@ -2289,7 +2296,7 @@ void AHuman::PreControllerUpdate() {
22892296
if (m_Status == STABLE) {
22902297
if (m_ArmClimbing[BGROUND]) {
22912298
// Can't climb or crawl with the shield
2292-
if (m_MoveState != CRAWL || m_ProneState == PRONE) {
2299+
if (m_MoveState != CRAWL || m_ProneState == LAYINGPRONE) {
22932300
UnequipBGArm();
22942301
}
22952302
m_pBGArm->AddHandTarget("Hand AtomGroup Limb Pos", m_pBGHandGroup->GetLimbPos(m_HFlipped));
@@ -2309,7 +2316,7 @@ void AHuman::PreControllerUpdate() {
23092316
m_pBGArm->SetRecoil(heldDevice->GetRecoilForce(), heldDevice->GetRecoilOffset(), heldDevice->IsRecoiled());
23102317
} else {
23112318
// BGArm did not reach to support the device. Count device as supported anyway, if crouching or prone.
2312-
heldDevice->SetSupported(m_MoveState == CROUCH || m_ProneState == PRONE);
2319+
heldDevice->SetSupported(m_MoveState == PRONE || m_ProneState == LAYINGPRONE);
23132320
m_pBGArm->SetRecoil(Vector(), Vector(), false);
23142321
}
23152322
}
@@ -2335,7 +2342,7 @@ void AHuman::PreControllerUpdate() {
23352342
if (arm && !arm->GetHeldDeviceThisArmIsTryingToSupport()) {
23362343
Leg* legToSwingWith = arm == m_pFGArm ? m_pBGLeg : m_pFGLeg;
23372344
Leg* otherLeg = legToSwingWith == m_pBGLeg ? m_pFGLeg : m_pBGLeg;
2338-
if (!legToSwingWith || m_MoveState == JUMP || m_MoveState == CROUCH) {
2345+
if (!legToSwingWith || m_MoveState == JUMP || m_MoveState == PRONE) {
23392346
std::swap(legToSwingWith, otherLeg);
23402347
}
23412348

@@ -2376,10 +2383,8 @@ void AHuman::Update() {
23762383
m_SharpAimMaxedOut = true;
23772384
} else if (m_MoveState == WALK) {
23782385
maxLength *= 0.7F;
2379-
}
2380-
2381-
// If we're fully crouching, improve our aim a little
2382-
if (m_MaxWalkPathCrouchShift > 0.0F && m_WalkPathOffset.m_Y * -1.0F >= m_MaxWalkPathCrouchShift * 0.9F) {
2386+
} else if (m_MoveState == CROUCH) {
2387+
// Only when crouching still, otherwise it's WALK
23832388
maxLength *= 1.2F;
23842389
}
23852390

@@ -2461,9 +2466,9 @@ void AHuman::Update() {
24612466
} else {
24622467
// Done going down, now stay down without spring.
24632468
m_AngularVel *= 0.5F;
2464-
m_ProneState = PRONE;
2469+
m_ProneState = LAYINGPRONE;
24652470
}
2466-
} else if (m_ProneState == PRONE) {
2471+
} else if (m_ProneState == LAYINGPRONE) {
24672472
// If down, try to keep flat against the ground.
24682473
if (std::abs(rotDiff) > c_SixteenthPI && std::abs(rotDiff) < c_HalfPI) {
24692474
m_AngularVel += rotDiff * 0.65F;
@@ -2475,18 +2480,22 @@ void AHuman::Update() {
24752480
// Upright body posture
24762481
float rotTarget = (GetRotAngleTarget(m_MoveState) * (m_AimAngle > 0 ? 1.0F - (m_AimAngle / c_HalfPI) : 1.0F) * GetFlipFactor());
24772482

2478-
// Lean forwards when crouching
2479-
float crouchAngleAdjust = m_HFlipped ? m_MaxCrouchRotation : -m_MaxCrouchRotation;
2480-
rotTarget += Lerp(0.0F, m_MaxWalkPathCrouchShift, 0.0F, crouchAngleAdjust, m_WalkPathOffset.m_Y * -1.0F);
2481-
2483+
if (m_MoveState != CROUCH) {
2484+
// In crouch state the above is rotated already, but in any other state we do the incremental lean here
2485+
float crouchAngleAdjust = m_HFlipped ? -m_RotAngleTargets[CROUCH] : m_RotAngleTargets[CROUCH];
2486+
float difference = crouchAngleAdjust - rotTarget;
2487+
rotTarget += Lerp(0.0F, 1.0F, 0.0F, difference, m_CrouchAmount);
2488+
}
2489+
24822490
float rotDiff = rot - rotTarget;
2483-
if (std::abs(rotDiff) > c_HalfPI) {
2491+
if (std::abs(rotDiff) > c_PI) {
24842492
// We've h-flipped, so just snap to new orientation
24852493
rot = rotTarget;
24862494
} else {
24872495
// Lerp towards the angle
24882496
m_AngularVel = m_AngularVel * (0.98F - 0.06F * (m_Health / m_MaxHealth)) - (rotDiff * 0.5F);
24892497
}
2498+
24902499
}
24912500
} else if (m_Status == UNSTABLE) {
24922501
float rotTarget = 0;

Source/Entities/AHuman.h

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace RTE {
3636
enum ProneState {
3737
NOTPRONE = 0,
3838
GOPRONE,
39-
PRONE,
39+
LAYINGPRONE,
4040
PRONESTATECOUNT
4141
};
4242

@@ -523,17 +523,9 @@ namespace RTE {
523523
/// @param newValue The new value for this AHuman's max walkpath adjustment.
524524
void SetMaxWalkPathCrouchShift(float newValue) { m_MaxWalkPathCrouchShift = newValue; }
525525

526-
/// Gets this AHuman's max crouch rotation to duck below low ceilings.
527-
/// @return This AHuman's max crouch rotation adjustment.
528-
float GetMaxCrouchRotation() const { return m_MaxCrouchRotation; }
529-
530-
/// Sets this AHuman's max crouch rotation to duck below low ceilings.
531-
/// @param newValue The new value for this AHuman's max crouch rotation adjustment.
532-
void SetMaxCrouchRotation(float newValue) { m_MaxCrouchRotation = newValue; }
533-
534526
/// Gets this AHuman's current crouch amount. 0.0 == fully standing, 1.0 == fully crouched.
535527
/// @return This AHuman's current crouch amount.
536-
float GetCrouchAmount() const { return (m_WalkPathOffset.m_Y * -1.0F) / m_MaxWalkPathCrouchShift; }
528+
float GetCrouchAmount() const { return m_CrouchAmount; }
537529

538530
/// Gets this AHuman's current crouch amount override. 0.0 == fully standing, 1.0 == fully crouched, -1 == no override.
539531
/// @return This AHuman's current crouch amount override.
@@ -613,10 +605,10 @@ namespace RTE {
613605
ProneState m_ProneState;
614606
// Timer for the going prone procedural animation
615607
Timer m_ProneTimer;
616-
// The maximum amount our walkpath can be shifted upwards to crouch and avoid ceilings above us
608+
// The maximum amount our walkpath can be shifted upwards to crouch, whether manually or automatically.
617609
float m_MaxWalkPathCrouchShift;
618-
// The maximum amount we will duck our head down to avoid obstacles above us.
619-
float m_MaxCrouchRotation;
610+
// The current crouching amount from 0.0 to 1.0, where 1.0 is applying maximum walk path shift.
611+
float m_CrouchAmount;
620612
// The script-set forced crouching amount. 0.0 == fully standing, 1.0 == fully crouched, -1 == no override.
621613
float m_CrouchAmountOverride;
622614
// Limb paths for different movement states.

Source/Entities/Actor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ void Actor::Clear() {
6666
m_TravelImpulseDamage = 750.0F;
6767
m_StableVel.SetXY(15.0F, 25.0F);
6868
m_StableRecoverDelay = 1000;
69+
m_CanRun = true;
6970
m_HeartBeat.Reset();
7071
m_NewControlTmr.Reset();
7172
m_DeathTmr.Reset();
@@ -198,6 +199,7 @@ int Actor::Create(const Actor& reference) {
198199
m_TravelImpulseDamage = reference.m_TravelImpulseDamage;
199200
m_StableVel = reference.m_StableVel;
200201
m_StableRecoverDelay = reference.m_StableRecoverDelay;
202+
m_CanRun = reference.m_CanRun;
201203
m_GoldCarried = reference.m_GoldCarried;
202204
m_AimState = reference.m_AimState;
203205
m_AimRange = reference.m_AimRange;
@@ -327,6 +329,7 @@ int Actor::ReadProperty(const std::string_view& propName, Reader& reader) {
327329
MatchProperty("ImpulseDamageThreshold", { reader >> m_TravelImpulseDamage; });
328330
MatchProperty("StableVelocityThreshold", { reader >> m_StableVel; });
329331
MatchProperty("StableRecoveryDelay", { reader >> m_StableRecoverDelay; });
332+
MatchProperty("CanRun", { reader >> m_CanRun; });
330333
MatchProperty("AimAngle", { reader >> m_AimAngle; });
331334
MatchProperty("AimRange", { reader >> m_AimRange; });
332335
MatchProperty("AimDistance", { reader >> m_AimDistance; });
@@ -401,6 +404,8 @@ int Actor::Save(Writer& writer) const {
401404
writer << m_StableVel;
402405
writer.NewProperty("StableRecoveryDelay");
403406
writer << m_StableRecoverDelay;
407+
writer.NewProperty("CanRun");
408+
writer << m_CanRun;
404409
writer.NewProperty("AimAngle");
405410
writer << m_AimAngle;
406411
writer.NewProperty("AimRange");

0 commit comments

Comments
 (0)