Make SteamWorks_HasLicenseForApp slightly easier to use.

This commit is contained in:
KyleSanderson
2014-01-12 13:11:36 -07:00
parent 0854157c93
commit 4721f44f98
+13 -1
View File
@@ -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]); return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
} }
CSteamID checkid(pPlayer->GetSteamAccountID(false), static_cast<EUniverse>(params[3]), static_cast<EAccountType>(params[4])); EUniverse universe = k_EUniversePublic;
EAccountType type = k_EAccountTypeIndividual;
if (params[0] > 2)
{
universe = static_cast<EUniverse>(params[3]);
if (params[0] > 3)
{
type = static_cast<EAccountType>(params[4]);
}
}
CSteamID checkid(pPlayer->GetSteamAccountID(false), universe, type);
return pServer->UserHasLicenseForApp(checkid, params[2]); return pServer->UserHasLicenseForApp(checkid, params[2]);
} }