Skip to content

Commit 7f556ad

Browse files
committed
Added lua r/w access to AHuman upper body state
1 parent 9a46078 commit 7f556ad

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
495495
- Added Lua convenience function `RoundToNearestMultiple(num, multiple)` which returns a number rounded to the nearest specified multiple.
496496
Note that this operates on integers, so fractional parts will be truncated towards zero by type conversion.
497497

498+
- Added `AHuman` Lua property (R/W) `UpperBodyState`, that lets you get and set the `AHuman`'s `UpperBodyState`. If you don't know what this does, you probably don't need or want it.
499+
498500
</details>
499501

500502
<details><summary><b>Changed</b></summary>

Entities/AHuman.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,18 @@ DefaultPieMenuNameGetter("Default Human Pie Menu");
577577
/// </summary>
578578
void UnequipArms() { UnequipFGArm(); UnequipBGArm(); }
579579

580+
/// <summary>
581+
/// Gets this AHuman's UpperBodyState.
582+
/// </summary>
583+
/// <returns>This AHuman's UpperBodyState.</returns>
584+
UpperBodyState GetUpperBodyState() const { return m_ArmsState; }
585+
586+
/// <summary>
587+
/// Sets this AHuman's UpperBodyState to the new state.
588+
/// </summary>
589+
/// <param name="newUpperBodyState">This AHuman's new UpperBodyState.</param>
590+
void SetUpperBodyState(UpperBodyState newUpperBodyState) { m_ArmsState = newUpperBodyState; }
591+
580592

581593
//////////////////////////////////////////////////////////////////////////////////////////
582594
// Method: GetEquippedItem

Lua/LuaBindingsEntities.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ namespace RTE {
440440
.property("LimbPathPushForce", &AHuman::GetLimbPathPushForce, &AHuman::SetLimbPathPushForce)
441441
.property("IsClimbing", &AHuman::IsClimbing)
442442
.property("ArmSwingRate", &AHuman::GetArmSwingRate, &AHuman::SetArmSwingRate)
443+
.property("UpperBodyState", &AHuman::GetUpperBodyState, &AHuman::SetUpperBodyState)
443444

444445
.def("EquipFirearm", &AHuman::EquipFirearm)
445446
.def("EquipThrowable", &AHuman::EquipThrowable)

0 commit comments

Comments
 (0)