p2sr / SourceAutoRecord

Speedrun plugin for Source engine games.
https://sar.portal2.sr/
MIT License
93 stars 29 forks source link

Running sar_update twice crashes the game #108

Open SirWillian opened 1 year ago

SirWillian commented 1 year ago

Discovered by wanting to update from 1.12.7-pre5 (or some 1.12.7 prerelease) to some version with sar_dpi_scale. Ran sar_update first and then sar_update pre immediately after

Also replicated by running sar_update pre force twice while using the latest prerelease (1.12.8-pre2)

Seems like the crash happens after the second download is finished as I believe i can read "Deleting old version.." being printed to console a split second before it crashes

ThisAMJ commented 1 year ago

I can't repro on Linux (1.12.8-pre2) As many as 7 sar_updates successfully ran

mlugg commented 1 year ago

This happens because of the way updating on Windows has to work (because Windows is weird about deleting files that already exist). Running sar_update a second time causes the temporary file containing the old SAR version to get overwritten. The fix should be pretty simple though - I'll take a look soon,