Reply to Re: DFArc3 beta-testing
If you don't have an account, just leave the password field blank.
Hmmm:
(that comes back from 1.07, let's have a nostalgia moment reading the old code
)
I suppose your problem happened when WDE2 read/wrote hard.dat just when the Dink was trying to read it -- under windows, where exclusive file opening doesn't seem to be so great at avoiding file corruption.
How about we ditch this "recreate a completely empty hard.dat on error" from the engine?
That doesn't seem to bring any value in the game, it only needs to be done in the editor.
/* If running the game, fallback to the default hard.dat, but if running the editor, recreate it in all cases. */ if (f == NULL && !dinkedit) f = paths_fallbackfile_fopen("hard.dat", "rb"); if (f == NULL) { //make new data file memset(&hmap, 0, sizeof(struct hardness)); save_hard(); return; }
(that comes back from 1.07, let's have a nostalgia moment reading the old code
if (!dinkedit) { if (!exist(crap)) sprintf(crap, "..\\dink\\hard.dat"); } fp = fopen(crap, "rb"); if (!fp) { //fclose(fp); fp = fopen(crap, "wb"); //make new data file ZeroMemory(&hmap, sizeof(struct hardness)); fwrite(&hmap,sizeof(struct hardness),1,fp); fclose(fp); }
)
I suppose your problem happened when WDE2 read/wrote hard.dat just when the Dink was trying to read it -- under windows, where exclusive file opening doesn't seem to be so great at avoiding file corruption.
How about we ditch this "recreate a completely empty hard.dat on error" from the engine?
That doesn't seem to bring any value in the game, it only needs to be done in the editor.