… | |
… | |
16 | |
16 | |
17 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | |
20 | |
21 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #include <global.h> |
24 | #include <global.h> |
25 | #include <object.h> |
25 | #include <object.h> |
26 | #include <tod.h> |
26 | #include <tod.h> |
… | |
… | |
1100 | |
1100 | |
1101 | void |
1101 | void |
1102 | process_events (mapstruct *map) |
1102 | process_events (mapstruct *map) |
1103 | { |
1103 | { |
1104 | object *op; |
1104 | object *op; |
1105 | object *marker = get_object (); |
|
|
1106 | tag_t tag; |
1105 | tag_t tag; |
|
|
1106 | |
|
|
1107 | static object *marker; |
|
|
1108 | |
|
|
1109 | if (!marker) |
|
|
1110 | marker = get_object (); |
1107 | |
1111 | |
1108 | process_players1 (map); |
1112 | process_players1 (map); |
1109 | |
1113 | |
1110 | marker->active_next = active_objects; |
1114 | marker->active_next = active_objects; |
1111 | |
1115 | |
… | |
… | |
1229 | marker->active_prev->active_next = NULL; |
1233 | marker->active_prev->active_next = NULL; |
1230 | else |
1234 | else |
1231 | active_objects = NULL; |
1235 | active_objects = NULL; |
1232 | |
1236 | |
1233 | process_players2 (map); |
1237 | process_players2 (map); |
1234 | |
|
|
1235 | free_object (marker); |
|
|
1236 | } |
1238 | } |
1237 | |
1239 | |
1238 | void |
1240 | void |
1239 | clean_tmp_files (void) |
1241 | clean_tmp_files (void) |
1240 | { |
1242 | { |
… | |
… | |
1273 | |
1275 | |
1274 | /* clean up everything before exiting */ |
1276 | /* clean up everything before exiting */ |
1275 | void |
1277 | void |
1276 | cleanup (void) |
1278 | cleanup (void) |
1277 | { |
1279 | { |
1278 | LOG (llevDebug, "Cleanup called. freeing data.\n"); |
1280 | LOG (llevDebug, "Cleanup called.\n"); |
1279 | clean_tmp_files (); |
|
|
1280 | write_book_archive (); |
1281 | write_book_archive (); |
1281 | #ifdef MEMORY_DEBUG |
|
|
1282 | free_all_maps (); |
|
|
1283 | free_style_maps (); |
|
|
1284 | free_all_object_data (); |
|
|
1285 | free_all_archs (); |
|
|
1286 | free_all_treasures (); |
|
|
1287 | free_all_images (); |
|
|
1288 | free_all_newserver (); |
|
|
1289 | free_all_recipes (); |
|
|
1290 | free_all_readable (); |
|
|
1291 | free_all_god (); |
|
|
1292 | free_all_anim (); |
|
|
1293 | /* See what the string data that is out there that hasn't been freed. */ |
|
|
1294 | |
1282 | |
1295 | /* LOG(llevDebug, ss_dump_table(0xff));*/ |
1283 | INVOKE_GLOBAL (CLEANUP); |
1296 | #endif |
1284 | |
1297 | exit (0); |
1285 | _exit (0); |
1298 | } |
1286 | } |
1299 | |
1287 | |
1300 | void |
1288 | void |
1301 | leave (player *pl, int draw_exit) |
1289 | leave (player *pl, int draw_exit) |
1302 | { |
1290 | { |