@ -74,7 +74,7 @@ void Menu::InitializeCharacterMenuWindow(){
} ;
const static std : : array < AttributeData , 7 > displayAttrs {
AttributeData { " Health " , [ & ] ( ) - > int { return game - > GetPlayer ( ) - > GetHealth ( ) ; } } ,
AttributeData { " Health " , [ & ] ( ) - > int { return game - > GetPlayer ( ) - > GetMax Health ( ) ; } } ,
AttributeData { " Attack " , [ & ] ( ) - > int { return game - > GetPlayer ( ) - > GetAttack ( ) ; } } ,
AttributeData { " Defense " , [ & ] ( ) - > int { return game - > GetPlayer ( ) - > GetStat ( " Defense " ) ; } } ,
AttributeData { " Move Spd % " , [ & ] ( ) - > int { return ceil ( game - > GetPlayer ( ) - > GetMoveSpdMult ( ) * 100 ) ; } } ,
@ -194,11 +194,14 @@ void Menu::InitializeCharacterMenuWindow(){
statsBeforeEquip . push_back ( attribute . calcFunc ( ) ) ;
}
int healthBeforeEquip = game - > GetPlayer ( ) - > GetHealth ( ) ;
int manaBeforeEquip = game - > GetPlayer ( ) - > GetMana ( ) ;
std : : weak_ptr < Item > equippedItem = Inventory : : GetEquip ( slot ) ;
std : : weak_ptr < Item > otherItem ;
if ( slot = = EquipSlot : : RING1 ) otherItem = Inventory : : GetEquip ( EquipSlot : : RING2 ) ;
if ( slot & EquipSlot : : RING1 ) otherItem = Inventory : : GetEquip ( EquipSlot : : RING2 ) ;
else
if ( slot = = EquipSlot : : RING2 ) otherItem = Inventory : : GetEquip ( EquipSlot : : RING1 ) ;
if ( slot & EquipSlot : : RING2 ) otherItem = Inventory : : GetEquip ( EquipSlot : : RING1 ) ;
if ( OppositeRingSlotDoesNotMatchCurrentEquip ( button . lock ( ) ) ) { //If we find that the opposite ring slot is equipped to us, this would be an item swap or the exact same ring, therefore no stat calculations apply.
Inventory : : EquipItem ( buttonItem , slot ) ;
for ( int counter = 0 ; const AttributeData & attribute : displayAttrs ) {
@ -210,6 +213,8 @@ void Menu::InitializeCharacterMenuWindow(){
Inventory : : UnequipItem ( slot ) ;
if ( ! ISBLANK ( equippedItem ) ) {
Inventory : : EquipItem ( equippedItem , slot ) ;
game - > GetPlayer ( ) - > Heal ( healthBeforeEquip - game - > GetPlayer ( ) - > GetHealth ( ) , true ) ;
game - > GetPlayer ( ) - > RestoreMana ( manaBeforeEquip - game - > GetPlayer ( ) - > GetMana ( ) , true ) ;
}
if ( ! ISBLANK ( otherItem ) ) {
if ( slot = = EquipSlot : : RING1 ) Inventory : : EquipItem ( otherItem , EquipSlot : : RING2 ) ;