From afb848e427fe40d8c654ec70e3363abe9a065e7b Mon Sep 17 00:00:00 2001 From: a Date: Fri, 6 Dec 2024 23:09:13 +0200 Subject: [PATCH] properly implement `Steam_Remote_Storage::UpdateUserPublishedItemVote()` --- dll/steam_remote_storage.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dll/steam_remote_storage.cpp b/dll/steam_remote_storage.cpp index b3dcb3c2..af374533 100644 --- a/dll/steam_remote_storage.cpp +++ b/dll/steam_remote_storage.cpp @@ -1030,12 +1030,14 @@ SteamAPICall_t Steam_Remote_Storage::UpdateUserPublishedItemVote( PublishedFileI RemoteStorageUpdateUserPublishedItemVoteResult_t data{}; data.m_nPublishedFileId = unPublishedFileId; if (settings->isModInstalled(unPublishedFileId)) { + data.m_eResult = EResult::k_EResultOK; auto mod = settings->getMod(unPublishedFileId); - if (mod.steamIDOwner == settings->get_local_steam_id().ConvertToUint64()) { - data.m_eResult = EResult::k_EResultOK; - } else { // not published by this user - data.m_eResult = EResult::k_EResultFail; // TODO is this correct? + if (bVoteUp) { + ++mod.votesUp; + } else { + ++mod.votesDown; } + settings->addModDetails(unPublishedFileId, mod); } else { // mod not installed data.m_eResult = EResult::k_EResultFail; // TODO is this correct? }