1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01: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; 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) 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 // 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: case 1015:
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
//Update level stats //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 //Finished level
if (trinkets() >= cl.numtrinkets()) if (trinkets() >= cl.numtrinkets())