Hey There , I’m trying to make new functions which will execute based on the other one,
I want to replace the tester, number Variable.
I would like to know how can i get, the return data “Success” from the QueryInventory function.
void UInventoryComponent_C::QueryInventory(TSubclassOf< class ACrafting_System > Item_Cata, int Qunantity, UInventoryComponent_C* Test, bool& Success, int& OutPut_Qunantity)
{
for (auto& Elem : Test->YourMap) //Here we iterate through the map, and find the Item/Key we are looking for, Check if the item exits, if it does then we increment the value of it
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Test"));
if (Elem.Key == ■■■■■■■■■■■■■■■■ you
{
if (Qunantity>=Elem.Value && Item_Cata)
{
OutPut_Qunantity = Elem.Value;
Success = true;
}
}
else
{
OutPut_Qunantity = Elem.Value;
Success = false;
}
}
OutPut_Qunantity = 2;
Success = true;
}
void UInventoryComponent_C::RemoveFromInventory(TSubclassOf<class ACrafting_System> Items_To_Be_Removed, int Qunantity, UInventoryComponent_C*Test, bool& Success)
{
bool tester = true;
int number = 1;
QueryInventory(Items_To_Be_Removed, Qunantity, Test, tester, number);
}