Skip to content

Commit 22e9e84

Browse files
authored
AHuman.cpp - remove item in rotated inventory
Forgot to put this down in the various places oops lmao
1 parent e9470db commit 22e9e84

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Source/Entities/AHuman.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ bool AHuman::EquipDeviceInGroup(std::string group, bool doEquip) {
717717

718718
// Erase the inventory entry containing the device we now have switched to
719719
*m_Inventory.begin() = 0;
720+
m_Inventory.pop_front();
720721

721722
// Now put the device we were looking for and found into the hand
722723
m_pFGArm->SetHeldDevice(pDevice);
@@ -762,9 +763,11 @@ bool AHuman::EquipLoadedFirearmInGroup(std::string group, std::string excludeGro
762763

763764
// We want to preserve inventory order, so rotate it to the device in question.
764765
std::rotate(m_Inventory.begin(), itr, m_Inventory.end());
766+
m_Inventory.pop_front();
765767

766768
// Erase the inventory entry containing the device we now have switched to
767769
*m_Inventory.begin() = 0;
770+
m_Inventory.pop_front();
768771

769772
// Now put the device we were looking for and found into the hand
770773
m_pFGArm->SetHeldDevice(pFirearm);
@@ -866,6 +869,7 @@ bool AHuman::EquipThrowable(bool doEquip) {
866869

867870
// Erase the inventory entry containing the device we now have switched to
868871
*m_Inventory.begin() = 0;
872+
m_Inventory.pop_front();
869873

870874
// Now put the device we were looking for and found into the hand
871875
m_pFGArm->SetHeldDevice(pThrown);
@@ -993,6 +997,7 @@ bool AHuman::EquipShield() {
993997

994998
// Erase the inventory entry containing the device we now have switched to
995999
*m_Inventory.begin() = 0;
1000+
m_Inventory.pop_front();
9961001

9971002
// Now put the device we were looking for and found into the hand
9981003
m_pFGArm->SetHeldDevice(pShield);
@@ -1055,6 +1060,7 @@ bool AHuman::EquipShieldInBGArm(bool depositToFront) {
10551060

10561061
// We want to preserve inventory order, so rotate it to the device in question.
10571062
std::rotate(m_Inventory.begin(), itr, m_Inventory.end());
1063+
m_Inventory.pop_front();
10581064

10591065
// Erase the inventory entry containing the device we now have switched to
10601066
*m_Inventory.begin() = 0;

0 commit comments

Comments
 (0)