Skip to content

Commit

Permalink
Updated key of hooked interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
acidicoala committed Jun 2, 2022
1 parent ec10445 commit d3a1118
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/steam_functions/steam_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ namespace steam_functions {
};

FunctionOrdinalMap steam_inventory_ordinal_map = { // NOLINT(cert-err58-cpp)
{"ISteamInventory_GetResultStatus", {{1, 0}}},
{"ISteamInventory_GetResultItems", {{1, 1}}},
{"ISteamInventory_GetResultItemProperty", {{2, 2}}},
{"ISteamInventory_CheckResultSteamID", {{1, 3}, {2, 4}}},
{"ISteamInventory_GetAllItems", {{1, 5}, {2, 6}}},
{"ISteamInventory_GetItemsByID", {{1, 6}, {2, 7}}},
{"ISteamInventory_SerializeResult", {{1, 7}, {2, 8}}},
{"ISteamInventory_GetItemDefinitionIDs", {{1, 20}, {2, 21}}},
{"ISteamInventory_GetResultStatus", {{1, 0}}},
{"ISteamInventory_GetResultItems", {{1, 1}}},
{"ISteamInventory_GetResultItemProperty", {{2, 2}}},
{"ISteamInventory_CheckResultSteamID", {{1, 3}, {2, 4}}},
{"ISteamInventory_GetAllItems", {{1, 5}, {2, 6}}},
{"ISteamInventory_GetItemsByID", {{1, 6}, {2, 7}}},
{"ISteamInventory_SerializeResult", {{1, 7}, {2, 8}}},
{"ISteamInventory_GetItemDefinitionIDs", {{1, 20}, {2, 21}}},
};

int extract_version_number(
Expand Down Expand Up @@ -138,9 +138,11 @@ namespace steam_functions {
return;
}

static Set<void*> hooked_interfaces;
static Set<std::pair<void*, String>> hooked_interfaces;

if (hooked_interfaces.contains(interface)) {
const auto interface_pair = std::pair{interface, version_string};

if (hooked_interfaces.contains(interface_pair)) {
// This interface is already hooked. Skipping it.
return;
}
Expand Down Expand Up @@ -196,7 +198,7 @@ namespace steam_functions {
return;
}

hooked_interfaces.insert(interface);
hooked_interfaces.insert(interface_pair);
}

HSteamPipe get_steam_pipe_or_throw() {
Expand Down

0 comments on commit d3a1118

Please sign in to comment.