1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-02 02:53:32 +02:00

Fix special/stdin.vvvvvv being saved to levelstats.vvv

While fixing #885, I noticed that I had a bunch of
`special/stdin.vvvvvv` entries saved in my `levelstats.vvv`. At once I
knew that the dumb `special/stdin` hack that actually checks if the
filename passed is `special/stdin` was to blame.

STDIN playtesting was first merged, I knew in the back of my mind that
it was a bit of a dumb hack, but I didn't know it would cause
consequences like showing up in `levelstats.vvv`. For now, I'll just
have to patch it, but hopefully in the future I'll remove the dumb hack
entirely. Commenting both instances of the dumb hack with instructions
to grep for it should help maintainers out.
This commit is contained in:
Misa 2022-08-03 17:30:23 -07:00
parent 550dfe676a
commit c3750e3b34
2 changed files with 6 additions and 1 deletions

View File

@ -571,6 +571,8 @@ void FILESYSTEM_loadFileToMemory(
goto fail;
}
/* FIXME: Dumb hack to use `special/stdin.vvvvvv` here...
* This is also checked elsewhere... grep for `special/stdin`! */
if (SDL_strcmp(name, "levels/special/stdin.vvvvvv") == 0)
{
// this isn't *technically* necessary when piping directly from a file, but checking for that is annoying

View File

@ -1965,7 +1965,10 @@ void Game::updatestate(void)
case 1015:
#if !defined(NO_CUSTOM_LEVELS)
//Update level stats
if(cl.numcrewmates()-crewmates()==0)
/* FIXME: Have to add check to not save stats for the dumb hack
* `special/stdin.vvvvvv` filename... see elsewhere, grep for
* `special/stdin`! */
if(cl.numcrewmates()-crewmates()==0 && customlevelfilename != "levels/special/stdin.vvvvvv")
{
//Finished level
if (trinkets() >= cl.numtrinkets())