1
0
Fork 0
mirror of https://gitlab.com/Mr_Goldberg/goldberg_emulator.git synced 2024-11-14 10:50:13 +01:00

Some small cleanups.

This commit is contained in:
Mr_Goldberg 2019-07-17 15:55:12 -04:00
parent 2a659043d3
commit 514f2ddbd9
No known key found for this signature in database
GPG key ID: 8597D87419DEF278

View file

@ -529,6 +529,8 @@ STEAM_METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of
bool LoadItemDefinitions() bool LoadItemDefinitions()
{ {
PRINT_DEBUG("LoadItemDefinitions\n"); PRINT_DEBUG("LoadItemDefinitions\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (!definition_update_called) { if (!definition_update_called) {
call_definition_update = true; call_definition_update = true;
} }
@ -549,6 +551,7 @@ bool GetItemDefinitionIDs(
STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize )
{ {
PRINT_DEBUG("GetItemDefinitionIDs\n"); PRINT_DEBUG("GetItemDefinitionIDs\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (!punItemDefIDsArraySize) if (!punItemDefIDsArraySize)
return false; return false;
@ -582,7 +585,8 @@ bool GetItemDefinitionIDs(
bool GetItemDefinitionProperty( SteamItemDef_t iDefinition, const char *pchPropertyName, bool GetItemDefinitionProperty( SteamItemDef_t iDefinition, const char *pchPropertyName,
STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut )
{ {
PRINT_DEBUG("GetItemDefinitionProperty\n"); PRINT_DEBUG("GetItemDefinitionProperty %i %s\n", iDefinition, pchPropertyName);
std::lock_guard<std::recursive_mutex> lock(global_mutex);
item_iterator item; item_iterator item;
if ((item = items.find(iDefinition)) != items.end()) if ((item = items.find(iDefinition)) != items.end())
@ -786,7 +790,6 @@ void RunCallbacks()
if (items_loaded) { if (items_loaded) {
if (call_definition_update) { if (call_definition_update) {
//call this callback even when 0 items?
SteamInventoryDefinitionUpdate_t data = {}; SteamInventoryDefinitionUpdate_t data = {};
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data)); callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
call_definition_update = false; call_definition_update = false;