When deleting a player also delete the Multiplayer efficiency file

This commit is contained in:
zicodxx 2010-01-29 00:35:20 +00:00
parent d17841fbc4
commit 9c4408adb2
2 changed files with 6 additions and 1 deletions

View file

@ -8,6 +8,7 @@ arch/sdl/window.c, main/automap.c, main/game.c, main/gamecntl.c, main/kconfig.c,
main/kconfig.c, main/newmenu.c: Tidy up newmenu_show/hide_cursor calls
main/newmenu.c: Allow user to abort close, for whatever reason (helps with my next commit)
main/gamesave.c, main/newdemo.c, main/object.c, main/object.h, main/state.c: Improved Object signature assignment and made sure there will be no duplicates; Also used short-ranged values only so Demo system won't screw up
main/menu.c: When deleting a player also delete the Multiplayer efficiency file
20100127
--------

View file

@ -441,7 +441,7 @@ int filename_menu_handler( listbox *lb, d_event *event, file_list *l )
x = nm_messagebox( NULL, 2, TXT_YES, TXT_NO, "%s %s?", TXT_DELETE_DEMO, items[citem]+(((l->mode == FILE_DEMO_MODE) && items[citem][0]=='$')?1:0) );
if (x==0) {
char * p;
char plxfile[PATH_MAX];
char plxfile[PATH_MAX], efffile[PATH_MAX];
int ret;
char name[PATH_MAX];
@ -462,6 +462,10 @@ int filename_menu_handler( listbox *lb, d_event *event, file_list *l )
sprintf(plxfile, GameArg.SysUsePlayersDir? "Players/%.8s.plx" : "%.8s.plx", items[citem]);
if (cfexist(plxfile))
PHYSFS_delete(plxfile);
// delete EFF file
sprintf(efffile, GameArg.SysUsePlayersDir? "Players/%.8s.eff" : "%.8s.eff", items[citem]);
if (cfexist(efffile))
PHYSFS_delete(efffile);
}
if (ret) {