From 39cb2c7c1776bb9f530ca62bb606f5029b675ed3 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Thu, 25 Jun 2020 11:26:40 -0400 Subject: [PATCH] Implement the promoitems functions. --- dll/steam_inventory.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/dll/steam_inventory.h b/dll/steam_inventory.h index 827abf8..2236d1d 100644 --- a/dll/steam_inventory.h +++ b/dll/steam_inventory.h @@ -453,6 +453,11 @@ STEAM_METHOD_DESC(GrantPromoItems() checks the list of promotional items for whi bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) { PRINT_DEBUG("GrantPromoItems\n"); + std::lock_guard lock(global_mutex); + struct Steam_Inventory_Requests* request = new_inventory_result(false); + + if (pResultHandle != nullptr) + *pResultHandle = request->inventory_result; return true; } @@ -464,13 +469,25 @@ bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) bool AddPromoItem( SteamInventoryResult_t *pResultHandle, SteamItemDef_t itemDef ) { PRINT_DEBUG("AddPromoItem\n"); - return false; + //TODO + std::lock_guard lock(global_mutex); + struct Steam_Inventory_Requests* request = new_inventory_result(false); + + if (pResultHandle != nullptr) + *pResultHandle = request->inventory_result; + return true; } bool AddPromoItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) { PRINT_DEBUG("AddPromoItems\n"); - return false; + //TODO + std::lock_guard lock(global_mutex); + struct Steam_Inventory_Requests* request = new_inventory_result(false); + + if (pResultHandle != nullptr) + *pResultHandle = request->inventory_result; + return true; }