Skip to content

Commit c09acd0

Browse files
committed
Fixed issue where m_MoveState was redefined in inheriting class, causing problems
1 parent 294fb26 commit c09acd0

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
9595

9696
- Fixed a bug in Harvester and Massacre where setting deploy units would auto-assign units of the wrong tech.
9797

98+
- Fixed an issue where an `Actor`'s MovementState wasn't correctly accessible from script.
99+
98100
</details>
99101

100102
<details><summary><b>Removed</b></summary>

Source/Entities/ACraft.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ MOSRotating* ACraft::Exit::SuckInMOs(ACraft* pExitOwner) {
180180
void ACraft::Clear() {
181181
m_AIMode = AIMODE_DELIVER;
182182

183-
m_MoveState = 0;
183+
m_MoveState = NOMOVE;
184184
m_HatchState = CLOSED;
185185
m_HatchTimer.Reset();
186186
m_HatchDelay = 0;

Source/Entities/ACraft.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ namespace RTE {
323323
protected:
324324
// Member variables
325325
static Entity::ClassInfo m_sClass;
326-
// Current movement state.
327-
unsigned int m_MoveState;
328326
// Current hatch action state.
329327
unsigned int m_HatchState;
330328
// Timer for opening and closing hatches

Source/Entities/AHuman.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,16 +1484,19 @@ void AHuman::PreControllerUpdate() {
14841484

14851485
if (!keepOldState) {
14861486
bool prone = m_Controller.IsState(BODY_PRONE);
1487+
14871488
// Engage prone state, this makes the body's rotational spring pull it horizontal instead of upright.
14881489
if (prone && m_ProneState == NOTPRONE) {
14891490
m_ProneState = GOPRONE;
14901491
m_ProneTimer.Reset();
14911492
}
1493+
14921494
if ((m_Controller.IsState(MOVE_RIGHT) || m_Controller.IsState(MOVE_LEFT) || m_MoveState == JUMP) && m_Status != INACTIVE) {
14931495
for (int i = WALK; i < MOVEMENTSTATECOUNT; ++i) {
14941496
m_Paths[FGROUND][i].SetHFlip(m_HFlipped);
14951497
m_Paths[BGROUND][i].SetHFlip(m_HFlipped);
14961498
}
1499+
14971500
// Only if not jumping, OR if jumping, and apparently stuck on something - then help out with the limbs.
14981501
if (m_MoveState != JUMP || isStill) {
14991502
MovementState oldMoveState = m_MoveState;

Source/Entities/AHuman.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,6 @@ namespace RTE {
597597
Timer m_IconBlinkTimer;
598598
// Current upper body state.
599599
UpperBodyState m_ArmsState;
600-
// Current movement state.
601-
MovementState m_MoveState;
602600
// Whether the guy is currently lying down on the ground, rotational spring pulling him that way
603601
// This is engaged if the player first crouches (still upright spring), and then presses left/right
604602
// It is disengaged as soon as the crouch button/direction is released

Source/Lua/LuaBindingsEntities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, Actor) {
179179
.property("CanRun", &Actor::GetCanRun, &Actor::SetCanRun)
180180
.property("CrouchWalkSpeedMultiplier", &Actor::GetCrouchWalkSpeedMultiplier, &Actor::SetCrouchWalkSpeedMultiplier)
181181
.property("Status", &Actor::GetStatus, &Actor::SetStatus)
182+
.property("MovementState", &Actor::GetMovementState, &Actor::SetMovementState)
182183
.property("Health", &Actor::GetHealth, &Actor::SetHealth)
183184
.property("PrevHealth", &Actor::GetPrevHealth)
184185
.property("MaxHealth", &Actor::GetMaxHealth, &Actor::SetMaxHealth)
@@ -413,7 +414,6 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, AHuman) {
413414
.property("CrouchAmountOverride", &AHuman::GetCrouchAmountOverride, &AHuman::SetCrouchAmountOverride)
414415
.property("StrideSound", &AHuman::GetStrideSound, &LuaAdaptersPropertyOwnershipSafetyFaker::AHumanSetStrideSound)
415416
.property("UpperBodyState", &AHuman::GetUpperBodyState, &AHuman::SetUpperBodyState)
416-
.property("MovementState", &AHuman::GetMovementState, &AHuman::SetMovementState)
417417
.property("ProneState", &AHuman::GetProneState, &AHuman::SetProneState)
418418
.property("ThrowPrepTime", &AHuman::GetThrowPrepTime, &AHuman::SetThrowPrepTime)
419419
.property("ThrowProgress", &AHuman::GetThrowProgress)

0 commit comments

Comments
 (0)