… | |
… | |
1276 | /* clean up everything before exiting */ |
1276 | /* clean up everything before exiting */ |
1277 | void |
1277 | void |
1278 | cleanup (void) |
1278 | cleanup (void) |
1279 | { |
1279 | { |
1280 | LOG (llevDebug, "Cleanup called.\n"); |
1280 | LOG (llevDebug, "Cleanup called.\n"); |
|
|
1281 | |
|
|
1282 | for (player *pl = first_player; pl != NULL; pl = pl->next) |
|
|
1283 | save_player (pl->ob, 0); |
|
|
1284 | |
|
|
1285 | for (player *pl = first_player; pl != NULL; pl = pl->next) |
|
|
1286 | if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) |
|
|
1287 | leave_map (pl->ob); |
|
|
1288 | |
|
|
1289 | clean_tmp_files (); |
1281 | write_book_archive (); |
1290 | write_book_archive (); |
1282 | |
1291 | |
1283 | INVOKE_GLOBAL (CLEANUP); |
1292 | INVOKE_GLOBAL (CLEANUP); |
1284 | |
1293 | |
1285 | _exit (0); |
1294 | _exit (0); |