Solve crash that occurs when selling items not in your loadout item slots. Release Build 7872.

This commit is contained in:
sigonasr2 2024-03-02 16:30:09 -06:00
parent 037e818f83
commit d909c140cf
7 changed files with 9 additions and 7 deletions

View File

@ -3558,7 +3558,7 @@ void AiL::GetAnyKeyRelease(Key key){
if(InputGroup::menuNamesToInputGroups.count(Menu::menus[NEW_INPUT]->S(A::KEYBIND))){
InputGroup::menuNamesToInputGroups[Menu::menus[NEW_INPUT]->S(A::KEYBIND)]->SetNewPrimaryKeybind(Input{KEY,key});
Menu::alreadyClicked=true;
for(auto&[menuType,menu]:Menu::menus){
for(auto[menuType,menu]:Menu::menus){
menu->helpDisplay.Initialize(menu->inputGroups);
}
Menu::CloseMenu();

View File

@ -48,7 +48,6 @@ INCLUDE_WINDOW_SIZE
InputHelper::InputHelper(){}
void InputHelper::Initialize(MenuInputGroups&inputGroups){
this->inputGroups.clear();
groupData=inputGroups;
}

View File

@ -787,7 +787,7 @@ void InputGroup::RemovePrimaryKeybind(InputType type){
}
void InputGroup::AddPrimaryKeybind(Input key){
keys.insert(key);
keyOrder.insert(keyOrder.begin(),{key.GetType(),key.key});
keyOrder.insert(keyOrder.begin(),key);
}
void InputGroup::SetNewPrimaryKeybind(Input key){
RemovePrimaryKeybind(key.GetType());

View File

@ -225,7 +225,7 @@ void Merchant::SellItem(std::weak_ptr<Item>item,uint32_t amt){
game->GetPlayer()->SetMoney(game->GetPlayer()->GetMoney()+totalCost);
//If we still have some in our inventory, we'll add them back in.
if(Inventory::GetItemCount(itemName)>0){
if(foundLoadoutSlot!=-1&&Inventory::GetItemCount(itemName)>0){
game->SetLoadoutItem(foundLoadoutSlot,itemName);
}

View File

@ -33,5 +33,8 @@ feature to lock accesoires to protect them from selling would be nice
Gorbit99's viewport PGEX
Original Nico Sprite
Inventory scroll bar doesn't reset its size
Address selling of items that are in equipment slots and loadout slots.
Story I-I should not unlock Stage I-II.
Initial Gold Crafting costs does not get subtracted properly.
Menu controls are not properly saved in system settings (only for emscripten?)
The keyboard display controls for the merchant are messed up?

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 4
#define VERSION_PATCH 2
#define VERSION_BUILD 7871
#define VERSION_BUILD 7872
#define stringify(a) stringify_(a)
#define stringify_(a) #a