Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 3908947

Browse files
committed
Review changes
1 parent b5f1d96 commit 3908947

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

CHANGELOG.md

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

255255
- Added `Entity` Lua function `entity:RemoveFromGroup(groupToRemoveFrom)` which removes the given group from the `Entity`. The reverse of `AddToGroup`.
256256

257+
- New `AHuman` Lua functions `GetWalkAngle(layer)` and `SetWalkAngle(layer)`, which can be used to read and override walk path rotation of both Legs/Layers respectively. The walk path rotation is automatically updated on each step to match the curvature of the terrain.
258+
257259
</details>
258260

259261
<details><summary><b>Changed</b></summary>

Entities/ACrab.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void ACrab::Clear()
5959
m_pJetpack = 0;
6060
m_JetTimeTotal = 0.0;
6161
m_JetTimeLeft = 0.0;
62-
m_JetReplenishRate = 1.75F;
62+
m_JetReplenishRate = 1.0F;
6363
m_JetAngleRange = 0.25F;
6464
m_MoveState = STAND;
6565
for (int side = 0; side < SIDECOUNT; ++side)
@@ -2162,7 +2162,7 @@ void ACrab::Update()
21622162
m_pJetpack->EnableEmission(false);
21632163
if (m_MoveState == JUMP) { m_MoveState = STAND; }
21642164

2165-
m_JetTimeLeft = std::min(m_JetTimeLeft + g_TimerMan.GetDeltaTimeMS() * m_JetReplenishRate, m_JetTimeTotal);
2165+
m_JetTimeLeft = std::min(m_JetTimeLeft + g_TimerMan.GetDeltaTimeMS() * 2.0F * m_JetReplenishRate, m_JetTimeTotal);
21662166
}
21672167

21682168
float maxAngle = c_HalfPI * m_JetAngleRange;

Entities/ACrab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ int FirearmActivationDelay() const;
597597
float m_JetTimeTotal;
598598
// How much time left the jetpack can go, in ms
599599
float m_JetTimeLeft;
600-
float m_JetReplenishRate; //!< How fast the jetpack fuel will replenish when not in use.
600+
float m_JetReplenishRate; //!< How fast the jetpack fuel will replenish when not in use, in relation to the legacy value.
601601
// Ratio at which the jetpack angle follows aim angle
602602
float m_JetAngleRange;
603603
// Blink timer

Entities/AHuman.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void AHuman::Clear()
7373
m_StrideStart = false;
7474
m_JetTimeTotal = 0.0;
7575
m_JetTimeLeft = 0.0;
76-
m_JetReplenishRate = 1.75F;
76+
m_JetReplenishRate = 1.0F;
7777
m_JetAngleRange = 0.25F;
7878
m_GoldInInventoryChunk = 0;
7979
m_ThrowTmr.Reset();
@@ -3155,7 +3155,7 @@ void AHuman::Update()
31553155
} else {
31563156
m_pJetpack->EnableEmission(false);
31573157
if (m_MoveState == JUMP) { m_MoveState = STAND; }
3158-
m_JetTimeLeft = std::min(m_JetTimeLeft + g_TimerMan.GetDeltaTimeMS() * m_JetReplenishRate, m_JetTimeTotal);
3158+
m_JetTimeLeft = std::min(m_JetTimeLeft + g_TimerMan.GetDeltaTimeMS() * 2.0F * m_JetReplenishRate, m_JetTimeTotal);
31593159
}
31603160

31613161
float maxAngle = c_HalfPI * m_JetAngleRange;

Entities/AHuman.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,13 @@ ClassInfoGetters;
779779
/// <param name="whichLayer">The Layer in question.</param>
780780
void UpdateWalkAngle(AHuman::Layer whichLayer);
781781

782+
/// <summary>
783+
/// Gets the walk path rotation for the specified Layer.
784+
/// </summary>
785+
/// <param name="whichLayer">The Layer in question.</param>
786+
/// <returns>The walk angle in radians.</returns>
787+
float GetWalkAngle(AHuman::Layer whichLayer) const { return m_WalkAngle[whichLayer].GetRadAngle(); }
788+
782789
/// <summary>
783790
/// Sets the walk path rotation for the specified Layer.
784791
/// </summary>
@@ -987,7 +994,7 @@ ClassInfoGetters;
987994
float m_JetTimeTotal;
988995
// How much time left the jetpack can go, in ms
989996
float m_JetTimeLeft;
990-
float m_JetReplenishRate; //!< How fast the jetpack fuel will replenish when not in use.
997+
float m_JetReplenishRate; //!< How fast the jetpack fuel will replenish when not in use, in relation to the legacy value.
991998
// Ratio at which the jetpack angle follows aim angle
992999
float m_JetAngleRange;
9931000
// Blink timer

Lua/LuaBindingsEntities.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ namespace RTE {
445445
.def("SetLimbPathSpeed", &AHuman::SetLimbPathSpeed)
446446
.def("GetRotAngleTarget", &AHuman::GetRotAngleTarget)
447447
.def("SetRotAngleTarget", &AHuman::SetRotAngleTarget)
448+
.def("GetWalkAngle", &AHuman::GetWalkAngle)
448449
.def("SetWalkAngle", &AHuman::SetWalkAngle)
449450

450451
.enum_("UpperBodyState")[

0 commit comments

Comments
 (0)