From 4721f44f988ad634bd2822d0344f3705c84e7a26 Mon Sep 17 00:00:00 2001 From: KyleSanderson Date: Sun, 12 Jan 2014 13:11:36 -0700 Subject: [PATCH] Make SteamWorks_HasLicenseForApp slightly easier to use. --- Extension/gsnatives.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Extension/gsnatives.cpp b/Extension/gsnatives.cpp index 182fcce..bb1956c 100644 --- a/Extension/gsnatives.cpp +++ b/Extension/gsnatives.cpp @@ -166,7 +166,19 @@ static cell_t sm_UserHasLicenseForApp(IPluginContext *pContext, const cell_t *pa return pContext->ThrowNativeError("Client index %d is invalid", params[1]); } - CSteamID checkid(pPlayer->GetSteamAccountID(false), static_cast(params[3]), static_cast(params[4])); + EUniverse universe = k_EUniversePublic; + EAccountType type = k_EAccountTypeIndividual; + + if (params[0] > 2) + { + universe = static_cast(params[3]); + if (params[0] > 3) + { + type = static_cast(params[4]); + } + } + + CSteamID checkid(pPlayer->GetSteamAccountID(false), universe, type); return pServer->UserHasLicenseForApp(checkid, params[2]); }