Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RA] Save game over existing file locks-up game #929

Open
Gerwin2k opened this issue May 26, 2023 · 0 comments
Open

[RA] Save game over existing file locks-up game #929

Gerwin2k opened this issue May 26, 2023 · 0 comments

Comments

@Gerwin2k
Copy link

Gerwin2k commented May 26, 2023

VanillaRA under WIN32 - An attempt to save a game over an existing file locks-up the game. One can only end this lock-up by forcing the program to close with the Windows task manager. The existing save file remains untouched.

Below is a quick fix that makes things work properly, by first checking for an existing file, in case it exists: delete it.
There is no asking for confirmation for the overwrite. The original game does not ask such either.
I am not 100% familiar with these Vanillla-conquer file functions, suppose a save_file.Close() is not necessary this way.

saveload.cpp, line 349:

bool NowSavingGame = false; // TEMP MBL: Need to discuss better solution with Steve
bool Save_Game(const char* file_name, const char* descr)
{

    // GB 2023 - prevent lockup when file already exists 
    CDFileClass save_file(file_name);
	if (save_file.Is_Available()) save_file.Delete();
    

	NowSavingGame = true; // TEMP MBL: Need to discuss better solution with Steve
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

No branches or pull requests

1 participant