Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Fixed an issue where internal Lua functions OriginalDoFile, OriginalLoadFile, and OriginalRequire were polluting the global namespace. They have now been made inaccessible.

- Various fixes and improvements to inventory management when dual-wielding or carrying a shield, to stop situations where the actor unexpectedly puts their items away.

- Fixed issue where MOSR `Gib`s, `AEmitter` or `PEmitter` `Emission`s, and MetaMan `Player`s were not correctly accessible from script.

- Fixed a crash on launch when the `SupportedGameVersion` INI property was not set.
Expand Down
3 changes: 2 additions & 1 deletion Resources/Credits.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ R"(- C O R T E X C O M M A N D C O M M U N I T Y P R O J E C T -

Programming
3 4 3 N
A L B E R T O " T H E P A W N " K U R T Y A N
A L B E R T O " T H E P A W N " K U R T Y A N
B I T G H O S T
C O M R A D E S H O O K
E V G E N I Y " W E E G E E " V I G O V S K I Y
F R I S 0 U M A N
Expand Down
23 changes: 15 additions & 8 deletions Source/Entities/AHuman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ bool AHuman::EquipShield() {
return false;
}

bool AHuman::EquipShieldInBGArm() {
bool AHuman::EquipShieldInBGArm(bool depositToFront) {
if (!(m_pBGArm && m_pBGArm->IsAttached())) {
return false;
}
Expand All @@ -1007,7 +1007,11 @@ bool AHuman::EquipShieldInBGArm() {
// If we're holding a shield, but aren't supposed to, because we need to support the FG hand's two-handed device, then let go of the shield and put it back in inventory.
if (m_pFGArm && m_pFGArm->IsAttached() && m_pFGArm->GetHeldDevice() && !m_pFGArm->GetHeldDevice()->IsOneHanded()) {
m_pBGArm->GetHeldDevice()->Deactivate();
AddToInventoryBack(m_pBGArm->RemoveAttachable(heldDevice));
if (depositToFront) {
AddToInventoryFront(m_pBGArm->RemoveAttachable(heldDevice));
} else {
AddToInventoryBack(m_pBGArm->RemoveAttachable(heldDevice));
}
return false;
}
return true;
Expand All @@ -1030,7 +1034,11 @@ bool AHuman::EquipShieldInBGArm() {
// Put back into the inventory what we had in our hands, if anything
if (HeldDevice* heldDevice = m_pBGArm->GetHeldDevice()) {
heldDevice->Deactivate();
AddToInventoryBack(m_pBGArm->RemoveAttachable(heldDevice));
if (depositToFront) {
AddToInventoryFront(m_pBGArm->RemoveAttachable(heldDevice));
} else {
AddToInventoryBack(m_pBGArm->RemoveAttachable(heldDevice));
}
}

// Now put the device we were looking for and found into the hand
Expand Down Expand Up @@ -1565,7 +1573,6 @@ void AHuman::PreControllerUpdate() {
}
// Disengage the prone state as soon as prone is released.
if (!prone && m_ProneState != NOTPRONE) {
EquipShieldInBGArm();
m_ProneState = NOTPRONE;
}
}
Expand Down Expand Up @@ -1613,7 +1620,7 @@ void AHuman::PreControllerUpdate() {
} else {
m_pFGArm->SetHeldDevice(dynamic_cast<HeldDevice*>(SwapPrevInventory(m_pFGArm->RemoveAttachable(m_pFGArm->GetHeldDevice()))));
}
EquipShieldInBGArm();
EquipShieldInBGArm(!changeNext);
m_pFGArm->SetHandPos(m_Pos + RotateOffset(m_HolsterOffset));
}
m_EquipHUDTimer.Reset();
Expand Down Expand Up @@ -2306,9 +2313,9 @@ void AHuman::PreControllerUpdate() {
if (m_Status == STABLE) {
if (m_ArmClimbing[BGROUND]) {
// Can't climb or crawl with the shield
if (m_MovementState != CRAWL || m_ProneState == LAYINGPRONE) {
UnequipBGArm();
}
// if (m_MovementState != CRAWL || m_ProneState == LAYINGPRONE) {
// UnequipBGArm();
//}
m_pBGArm->AddHandTarget("Hand AtomGroup Limb Pos", m_pBGHandGroup->GetLimbPos(m_HFlipped));
} else {
HeldDevice* heldDevice = GetEquippedItem();
Expand Down
2 changes: 1 addition & 1 deletion Source/Entities/AHuman.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ namespace RTE {
/// this only works if nothing is held at all, or the FG arm holds a
/// one-handed device, or we're in inventory mode.
/// @return Whether a shield was successfully equipped in the background arm.
bool EquipShieldInBGArm();
bool EquipShieldInBGArm(bool depositToFront = false);

/// Tries to equip the first dual-wieldable in inventory to the background arm;
/// this only works if nothing is held at all, or the FG arm holds a
Expand Down
2 changes: 1 addition & 1 deletion Source/Lua/LuaBindingsEntities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, AHuman) {
.def("EquipThrowable", &AHuman::EquipThrowable)
.def("EquipDiggingTool", &AHuman::EquipDiggingTool)
.def("EquipShield", &AHuman::EquipShield)
.def("EquipShieldInBGArm", &AHuman::EquipShieldInBGArm)
.def("EquipShieldInBGArm", (bool(AHuman::*)()) & AHuman::EquipShieldInBGArm)
.def("EquipDeviceInGroup", &AHuman::EquipDeviceInGroup)
.def("EquipNamedDevice", (bool(AHuman::*)(const std::string&, bool)) & AHuman::EquipNamedDevice)
.def("EquipNamedDevice", (bool(AHuman::*)(const std::string&, const std::string&, bool)) & AHuman::EquipNamedDevice)
Expand Down
Loading