Skip to content

steam: Fix float stat truncation, outdated macOS SDK path, and VS det…#367

Open
andy5995 wants to merge 1 commit intodevelopfrom
update-steam
Open

steam: Fix float stat truncation, outdated macOS SDK path, and VS det…#367
andy5995 wants to merge 1 commit intodevelopfrom
update-steam

Conversation

@andy5995
Copy link
Copy Markdown
Collaborator

…ection

steamshim_child.c: Fix float stat values being silently truncated to integers. In processEvent(), SHIMEVENT_SETSTATF/GETSTATF was assigning float values as:

event.fvalue = (int)*((float *)buf);

The erroneous (int) cast discarded the fractional part before assigning to the float field. This meant stats like stat_online_minutes_played (a float) were always rounded down to whole numbers. Remove the cast so the float value is assigned directly.

steamshim_parent/Makefile: Update macOS redistributable library path from osx32 to osx. Valve renamed the directory when they dropped 32-bit macOS support in Steamworks SDK ~1.42 (2018). Building the Steam shim for HOST=osx would fail to link because the path no longer exists in any recent SDK.

steamshim_parent/build.bat: Add support for Visual Studio 2017, 2019, and 2022. Previously the script only detected VS2015 (VS140COMNTOOLS). Now it first tries vswhere.exe (available since VS2017, the standard Microsoft-recommended discovery mechanism) to locate the latest installed VS with C++ tools. Falls back to the legacy VS2015 check if vswhere is not found.

@andy5995 andy5995 marked this pull request as draft March 21, 2026 03:00
@andy5995
Copy link
Copy Markdown
Collaborator Author

I'll rebase this branch after #370 is merged and mark this PR as ready-to-review.

@andy5995 andy5995 marked this pull request as ready for review March 21, 2026 03:09
…ection

steamshim_child.c: Fix float stat values being silently truncated to
integers. In processEvent(), SHIMEVENT_SETSTATF/GETSTATF was assigning
float values as:

    event.fvalue = (int)*((float *)buf);

The erroneous (int) cast discarded the fractional part before assigning
to the float field. This meant stats like stat_online_minutes_played
(a float) were always rounded down to whole numbers. Remove the cast so
the float value is assigned directly.

steamshim_parent/Makefile: Update macOS redistributable library path
from osx32 to osx. Valve renamed the directory when they dropped 32-bit
macOS support in Steamworks SDK ~1.42 (2018). Building the Steam shim
for HOST=osx would fail to link because the path no longer exists in
any recent SDK.

steamshim_parent/build.bat: Add support for Visual Studio 2017, 2019,
and 2022. Previously the script only detected VS2015 (VS140COMNTOOLS).
Now it first tries vswhere.exe (available since VS2017, the standard
Microsoft-recommended discovery mechanism) to locate the latest
installed VS with C++ tools. Falls back to the legacy VS2015 check if
vswhere is not found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant