From 736d1a9090d5f98c6e3aa437795877fe5452cd3e Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Sat, 5 Oct 2019 15:41:28 -0400 Subject: [PATCH] Make isteamutils call result functions respect callback delays. --- dll/base.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dll/base.h b/dll/base.h index 4b3453e..f549c1f 100644 --- a/dll/base.h +++ b/dll/base.h @@ -110,8 +110,12 @@ struct Steam_Call_Result { return check_timedout(created, STEAM_CALLRESULT_TIMEOUT); } + bool call_completed() { + return (!reserved) && check_timedout(created, run_in); + } + bool can_execute() { - return (!reserved) && (!to_delete) && check_timedout(created, run_in); + return (!to_delete) && call_completed(); } bool has_cb() { @@ -169,14 +173,14 @@ public: bool exists(SteamAPICall_t api_call) { auto cr = std::find_if(callresults.begin(), callresults.end(), [api_call](struct Steam_Call_Result const& item) { return item.api_call == api_call; }); if (cr == callresults.end()) return false; - if (cr->reserved) return false; + if (!cr->call_completed()) return false; return true; } bool callback_result(SteamAPICall_t api_call, void *copy_to, unsigned int size) { auto cb_result = std::find_if(callresults.begin(), callresults.end(), [api_call](struct Steam_Call_Result const& item) { return item.api_call == api_call; }); if (cb_result != callresults.end()) { - if (cb_result->reserved) return false; + if (!cb_result->call_completed()) return false; if (cb_result->result.size() > size) return false; memcpy(copy_to, &(cb_result->result[0]), cb_result->result.size());