… | |
… | |
106 | new_draw_info (NDI_UNIQUE, 0, op, "Images and art:"); |
106 | new_draw_info (NDI_UNIQUE, 0, op, "Images and art:"); |
107 | new_draw_info (NDI_UNIQUE, 0, op, "Peter Gardner"); |
107 | new_draw_info (NDI_UNIQUE, 0, op, "Peter Gardner"); |
108 | new_draw_info (NDI_UNIQUE, 0, op, "David Gervais [david_eg@mail.com]"); |
108 | new_draw_info (NDI_UNIQUE, 0, op, "David Gervais [david_eg@mail.com]"); |
109 | new_draw_info (NDI_UNIQUE, 0, op, "Mitsuhiro Itakura [ita@gold.koma.jaeri.go.jp]"); |
109 | new_draw_info (NDI_UNIQUE, 0, op, "Mitsuhiro Itakura [ita@gold.koma.jaeri.go.jp]"); |
110 | new_draw_info (NDI_UNIQUE, 0, op, "Hansjoerg Malthaner [hansjoerg.malthaner@danet.de]"); |
110 | new_draw_info (NDI_UNIQUE, 0, op, "Hansjoerg Malthaner [hansjoerg.malthaner@danet.de]"); |
111 | new_draw_info (NDI_UNIQUE, 0, op, "Mårten Woxberg [maxmc@telia.com]"); |
111 | new_draw_info (NDI_UNIQUE, 0, op, "MÃ¥rten Woxberg [maxmc@telia.com]"); |
112 | new_draw_info (NDI_UNIQUE, 0, op, "And many more!"); |
112 | new_draw_info (NDI_UNIQUE, 0, op, "And many more!"); |
113 | } |
113 | } |
114 | |
114 | |
115 | void |
115 | void |
116 | info_keys (object *op) |
116 | info_keys (object *op) |
… | |
… | |
158 | * simple case at top - no encryption - makes it easier to read. |
158 | * simple case at top - no encryption - makes it easier to read. |
159 | */ |
159 | */ |
160 | char * |
160 | char * |
161 | crypt_string (char *str, char *salt) |
161 | crypt_string (char *str, char *salt) |
162 | { |
162 | { |
163 | #if defined(WIN32) || (defined(__FreeBSD__) && !defined(HAVE_LIBDES)) |
163 | #if (defined(__FreeBSD__) && !defined(HAVE_LIBDES)) |
164 | return (str); |
164 | return (str); |
165 | #else |
165 | #else |
166 | static char *c = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; |
166 | static char *c = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; |
167 | char s[2]; |
167 | char s[2]; |
168 | |
168 | |
… | |
… | |
194 | enter_player_savebed (object *op) |
194 | enter_player_savebed (object *op) |
195 | { |
195 | { |
196 | maptile *oldmap = op->map; |
196 | maptile *oldmap = op->map; |
197 | object *tmp; |
197 | object *tmp; |
198 | |
198 | |
199 | tmp = get_object (); |
199 | tmp = object::create (); |
200 | |
200 | |
201 | EXIT_PATH (tmp) = op->contr->savebed_map; |
201 | EXIT_PATH (tmp) = op->contr->savebed_map; |
202 | EXIT_X (tmp) = op->contr->bed_x; |
202 | EXIT_X (tmp) = op->contr->bed_x; |
203 | EXIT_Y (tmp) = op->contr->bed_y; |
203 | EXIT_Y (tmp) = op->contr->bed_y; |
204 | enter_exit (op, tmp); |
204 | enter_exit (op, tmp); |
… | |
… | |
217 | EXIT_PATH (tmp) = op->contr->savebed_map; |
217 | EXIT_PATH (tmp) = op->contr->savebed_map; |
218 | EXIT_X (tmp) = op->contr->bed_x; |
218 | EXIT_X (tmp) = op->contr->bed_x; |
219 | EXIT_Y (tmp) = op->contr->bed_y; |
219 | EXIT_Y (tmp) = op->contr->bed_y; |
220 | enter_exit (op, tmp); |
220 | enter_exit (op, tmp); |
221 | } |
221 | } |
222 | free_object (tmp); |
222 | |
|
|
223 | tmp->destroy (); |
223 | } |
224 | } |
224 | |
225 | |
225 | /* All this really is is a glorified remove_object that also updates |
226 | /* All this really is is a glorified remove_object that also updates |
226 | * the counts on the map if needed. |
227 | * the counts on the map if needed. |
227 | */ |
228 | */ |
228 | void |
229 | void |
229 | leave_map (object *op) |
230 | leave_map (object *op) |
230 | { |
231 | { |
231 | maptile *oldmap = op->map; |
232 | maptile *oldmap = op->map; |
232 | |
233 | |
233 | remove_ob (op); |
234 | op->remove (); |
234 | |
235 | |
235 | if (oldmap) |
236 | if (oldmap) |
236 | { |
237 | { |
237 | if (!op->contr->hidden) |
238 | if (!op->contr->hidden) |
238 | oldmap->players--; |
239 | oldmap->players--; |
|
|
240 | |
239 | if (oldmap->players <= 0) |
241 | if (oldmap->players <= 0) |
240 | { /* can be less than zero due to errors in tracking this */ |
242 | /* can be less than zero due to errors in tracking this */ |
241 | set_map_timeout (oldmap); |
243 | set_map_timeout (oldmap); |
242 | } |
|
|
243 | } |
244 | } |
244 | } |
245 | } |
245 | |
246 | |
246 | /* |
247 | /* |
247 | * enter_map(): Moves the player and pets from current map (if any) to |
248 | * enter_map(): Moves the player and pets from current map (if any) to |
… | |
… | |
266 | newmap->path, x, y, MAP_WIDTH (newmap), MAP_HEIGHT (newmap)); |
267 | newmap->path, x, y, MAP_WIDTH (newmap), MAP_HEIGHT (newmap)); |
267 | new_draw_info (NDI_UNIQUE, 0, op, "The exit is closed"); |
268 | new_draw_info (NDI_UNIQUE, 0, op, "The exit is closed"); |
268 | return; |
269 | return; |
269 | } |
270 | } |
270 | } |
271 | } |
|
|
272 | |
271 | /* try to find a spot for the player */ |
273 | /* try to find a spot for the player */ |
272 | if (ob_blocked (op, newmap, x, y)) |
274 | if (ob_blocked (op, newmap, x, y)) |
273 | { /* First choice blocked */ |
275 | { /* First choice blocked */ |
274 | /* We try to find a spot for the player, starting closest in. |
276 | /* We try to find a spot for the player, starting closest in. |
275 | * We could use find_first_free_spot, but that doesn't randomize it at all, |
277 | * We could use find_first_free_spot, but that doesn't randomize it at all, |
… | |
… | |
284 | { |
286 | { |
285 | i = find_free_spot (op, newmap, x, y, 1, SIZEOFFREE2 + 1); |
287 | i = find_free_spot (op, newmap, x, y, 1, SIZEOFFREE2 + 1); |
286 | if (i == -1) |
288 | if (i == -1) |
287 | i = find_free_spot (op, newmap, x, y, 1, SIZEOFFREE); |
289 | i = find_free_spot (op, newmap, x, y, 1, SIZEOFFREE); |
288 | } |
290 | } |
|
|
291 | |
289 | if (i != -1) |
292 | if (i != -1) |
290 | { |
293 | { |
291 | x += freearr_x[i]; |
294 | x += freearr_x[i]; |
292 | y += freearr_y[i]; |
295 | y += freearr_y[i]; |
293 | } |
296 | } |
… | |
… | |
296 | /* not much we can do in this case. */ |
299 | /* not much we can do in this case. */ |
297 | LOG (llevInfo, "enter_map: Could not find free spot for player - will dump on top of object (%s: %d, %d)\n", newmap->path, x, y); |
300 | LOG (llevInfo, "enter_map: Could not find free spot for player - will dump on top of object (%s: %d, %d)\n", newmap->path, x, y); |
298 | } |
301 | } |
299 | } /* end if looking for free spot */ |
302 | } /* end if looking for free spot */ |
300 | |
303 | |
301 | if (op->map != NULL) |
304 | if (op->map) |
302 | { |
|
|
303 | INVOKE_PLAYER (MAP_CHANGE, op->contr, ARG_MAP (op->map), ARG_MAP (newmap)); |
|
|
304 | INVOKE_MAP (LEAVE, op->map, ARG_PLAYER (op->contr)); |
305 | if (INVOKE_MAP (LEAVE, op->map, ARG_PLAYER (op->contr))) |
305 | } |
306 | return; |
|
|
307 | |
|
|
308 | if (INVOKE_PLAYER (MAP_CHANGE, op->contr, ARG_MAP (newmap), ARG_INT (x), ARG_INT (y))) |
|
|
309 | return; |
|
|
310 | |
|
|
311 | if (INVOKE_MAP (ENTER, newmap, ARG_PLAYER (op->contr), ARG_INT (x), ARG_INT (y))) |
|
|
312 | return; |
306 | |
313 | |
307 | /* If it is a player login, he has yet to be inserted anyplace. |
314 | /* If it is a player login, he has yet to be inserted anyplace. |
308 | * otherwise, we need to deal with removing the player here. |
315 | * otherwise, we need to deal with removing the player here. |
309 | */ |
316 | */ |
310 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
317 | op->remove (); |
311 | remove_ob (op); |
|
|
312 | |
318 | |
313 | /* remove_ob clears these so they must be reset after the remove_ob call */ |
319 | /* remove_ob clears these so they must be reset after the remove_ob call */ |
314 | op->x = x; |
320 | op->x = x; |
315 | op->y = y; |
321 | op->y = y; |
316 | op->map = newmap; |
322 | op->map = newmap; |
|
|
323 | |
317 | insert_ob_in_map (op, op->map, NULL, INS_NO_WALK_ON); |
324 | insert_ob_in_map (op, op->map, NULL, INS_NO_WALK_ON); |
318 | |
|
|
319 | INVOKE_MAP (ENTER, op->map, ARG_PLAYER (op->contr)); |
|
|
320 | |
325 | |
321 | if (!op->contr->hidden) |
326 | if (!op->contr->hidden) |
322 | newmap->players++; |
327 | newmap->players++; |
323 | |
328 | |
324 | newmap->timeout = 0; |
329 | newmap->timeout = 0; |
… | |
… | |
334 | if (op->type == PLAYER && op->contr->ranges[range_golem] != NULL) |
339 | if (op->type == PLAYER && op->contr->ranges[range_golem] != NULL) |
335 | { |
340 | { |
336 | int i = find_free_spot (op->contr->ranges[range_golem], newmap, |
341 | int i = find_free_spot (op->contr->ranges[range_golem], newmap, |
337 | x, y, 1, SIZEOFFREE); |
342 | x, y, 1, SIZEOFFREE); |
338 | |
343 | |
339 | remove_ob (op->contr->ranges[range_golem]); |
344 | op->contr->ranges[range_golem]->remove (); |
|
|
345 | |
340 | if (i == -1) |
346 | if (i == -1) |
341 | { |
347 | { |
342 | remove_friendly_object (op->contr->ranges[range_golem]); |
348 | remove_friendly_object (op->contr->ranges[range_golem]); |
343 | free_object (op->contr->ranges[range_golem]); |
349 | op->contr->ranges[range_golem]->destroy (); |
344 | op->contr->ranges[range_golem] = NULL; |
350 | op->contr->ranges[range_golem] = 0; |
345 | op->contr->golem_count = 0; |
|
|
346 | } |
351 | } |
347 | else |
352 | else |
348 | { |
353 | { |
349 | object *tmp; |
|
|
350 | |
|
|
351 | for (tmp = op->contr->ranges[range_golem]; tmp != NULL; tmp = tmp->more) |
354 | for (object *tmp = op->contr->ranges[range_golem]; tmp != NULL; tmp = tmp->more) |
352 | { |
355 | { |
353 | tmp->x = x + freearr_x[i] + (tmp->arch == NULL ? 0 : tmp->arch->clone.x); |
356 | tmp->x = x + freearr_x[i] + (tmp->arch == NULL ? 0 : tmp->arch->clone.x); |
354 | tmp->y = y + freearr_y[i] + (tmp->arch == NULL ? 0 : tmp->arch->clone.y); |
357 | tmp->y = y + freearr_y[i] + (tmp->arch == NULL ? 0 : tmp->arch->clone.y); |
355 | tmp->map = newmap; |
358 | tmp->map = newmap; |
356 | } |
359 | } |
|
|
360 | |
357 | insert_ob_in_map (op->contr->ranges[range_golem], newmap, NULL, 0); |
361 | insert_ob_in_map (op->contr->ranges[range_golem], newmap, NULL, 0); |
358 | op->contr->ranges[range_golem]->direction = |
362 | op->contr->ranges[range_golem]->direction = |
359 | find_dir_2 (op->x - op->contr->ranges[range_golem]->x, op->y - op->contr->ranges[range_golem]->y); |
363 | find_dir_2 (op->x - op->contr->ranges[range_golem]->x, op->y - op->contr->ranges[range_golem]->y); |
360 | } |
364 | } |
361 | } |
365 | } |
|
|
366 | |
362 | op->direction = 0; |
367 | op->direction = 0; |
363 | |
368 | |
364 | /* since the players map is already loaded, we don't need to worry |
369 | /* since the players map is already loaded, we don't need to worry |
365 | * about pending objects. |
370 | * about pending objects. |
366 | */ |
371 | */ |
… | |
… | |
390 | /* Do MINTIMEOUT first, so that MAXTIMEOUT is used if that is |
395 | /* Do MINTIMEOUT first, so that MAXTIMEOUT is used if that is |
391 | * lower than the min value. |
396 | * lower than the min value. |
392 | */ |
397 | */ |
393 | # if MAP_MINTIMEOUT |
398 | # if MAP_MINTIMEOUT |
394 | if (oldmap->timeout < MAP_MINTIMEOUT) |
399 | if (oldmap->timeout < MAP_MINTIMEOUT) |
395 | { |
|
|
396 | oldmap->timeout = MAP_MINTIMEOUT; |
400 | oldmap->timeout = MAP_MINTIMEOUT; |
397 | } |
|
|
398 | # endif |
401 | # endif |
|
|
402 | |
399 | if (oldmap->timeout > MAP_MAXTIMEOUT) |
403 | if (oldmap->timeout > MAP_MAXTIMEOUT) |
400 | { |
|
|
401 | oldmap->timeout = MAP_MAXTIMEOUT; |
404 | oldmap->timeout = MAP_MAXTIMEOUT; |
402 | } |
405 | |
403 | #else |
406 | #else |
404 | /* save out the map */ |
407 | /* save out the map */ |
405 | swap_map (oldmap); |
408 | swap_map (oldmap); |
406 | #endif /* MAP_MAXTIMEOUT */ |
409 | #endif /* MAP_MAXTIMEOUT */ |
407 | } |
410 | } |
… | |
… | |
541 | */ |
544 | */ |
542 | LOG (llevError, "enter_fixed_template_map: Exit %s (%d,%d) on map %s has no source template.\n", |
545 | LOG (llevError, "enter_fixed_template_map: Exit %s (%d,%d) on map %s has no source template.\n", |
543 | &exit_ob->name, exit_ob->x, exit_ob->y, exit_ob->map->path); |
546 | &exit_ob->name, exit_ob->x, exit_ob->y, exit_ob->map->path); |
544 | return; |
547 | return; |
545 | } |
548 | } |
|
|
549 | |
546 | *sourcemap++ = '\0'; |
550 | *sourcemap++ = '\0'; |
547 | |
551 | |
548 | /* If we are not coming from a template map, we can use relative directories |
552 | /* If we are not coming from a template map, we can use relative directories |
549 | * for the map to generate from. |
553 | * for the map to generate from. |
550 | */ |
554 | */ |
551 | if (!exit_ob->map->templatemap) |
555 | if (!exit_ob->map->templatemap) |
552 | { |
|
|
553 | sourcemap = path_combine_and_normalize (exit_ob->map->path, sourcemap); |
556 | sourcemap = path_combine_and_normalize (exit_ob->map->path, sourcemap); |
554 | } |
|
|
555 | |
557 | |
556 | /* Do replacement of %x, %y, and %n to the x coord of the exit, the y coord |
558 | /* Do replacement of %x, %y, and %n to the x coord of the exit, the y coord |
557 | * of the exit, and the name of the map the exit is on, respectively. |
559 | * of the exit, and the name of the map the exit is on, respectively. |
558 | */ |
560 | */ |
559 | sprintf (tmpnum, "%d", exit_ob->x); |
561 | sprintf (tmpnum, "%d", exit_ob->x); |
… | |
… | |
568 | |
570 | |
569 | /* If we are coming from another template map, use reletive paths unless |
571 | /* If we are coming from another template map, use reletive paths unless |
570 | * indicated otherwise. |
572 | * indicated otherwise. |
571 | */ |
573 | */ |
572 | if (exit_ob->map->templatemap && (resultname[0] != '/')) |
574 | if (exit_ob->map->templatemap && (resultname[0] != '/')) |
573 | { |
|
|
574 | new_map_name = path_combine_and_normalize (exit_ob->map->path, resultname); |
575 | new_map_name = path_combine_and_normalize (exit_ob->map->path, resultname); |
575 | } |
|
|
576 | else |
576 | else |
577 | { |
|
|
578 | new_map_name = create_template_pathname (resultname); |
577 | new_map_name = create_template_pathname (resultname); |
579 | } |
|
|
580 | |
578 | |
581 | /* Attempt to load the map, if unable to, then |
579 | /* Attempt to load the map, if unable to, then |
582 | * create the map from the template. |
580 | * create the map from the template. |
583 | */ |
581 | */ |
584 | new_map = ready_map_name (new_map_name, MAP_PLAYER_UNIQUE); |
582 | new_map = ready_map_name (new_map_name, MAP_PLAYER_UNIQUE); |
… | |
… | |
605 | */ |
603 | */ |
606 | LOG (llevDebug, "enter_fixed_template_map: Exit %s (%d,%d) on map %s leads no where.\n", |
604 | LOG (llevDebug, "enter_fixed_template_map: Exit %s (%d,%d) on map %s leads no where.\n", |
607 | &exit_ob->name, exit_ob->x, exit_ob->y, exit_ob->map->path); |
605 | &exit_ob->name, exit_ob->x, exit_ob->y, exit_ob->map->path); |
608 | } |
606 | } |
609 | } |
607 | } |
610 | |
|
|
611 | |
608 | |
612 | /* The player is trying to enter a randomly generated template map. In this |
609 | /* The player is trying to enter a randomly generated template map. In this |
613 | * case, generate the map as needed. |
610 | * case, generate the map as needed. |
614 | */ |
611 | */ |
615 | |
612 | |
… | |
… | |
780 | #define PORTAL_DESTINATION_NAME "Town portal destination" /* this one should really be in a header file */ |
777 | #define PORTAL_DESTINATION_NAME "Town portal destination" /* this one should really be in a header file */ |
781 | object *tmp; |
778 | object *tmp; |
782 | |
779 | |
783 | /* It may be nice to support other creatures moving across |
780 | /* It may be nice to support other creatures moving across |
784 | * exits, but right now a lot of the code looks at op->contr, |
781 | * exits, but right now a lot of the code looks at op->contr, |
785 | * so thta is an RFE. |
782 | * so that is an RFE. |
786 | */ |
783 | */ |
787 | if (op->type != PLAYER) |
784 | if (op->type != PLAYER) |
788 | return; |
785 | return; |
789 | |
786 | |
790 | /* First, lets figure out what map the player is going to go to */ |
787 | /* First, lets figure out what map the player is going to go to */ |
791 | if (exit_ob) |
788 | if (exit_ob) |
792 | { |
789 | { |
793 | |
|
|
794 | /* check to see if we make a template map */ |
790 | /* check to see if we make a template map */ |
795 | if (EXIT_PATH (exit_ob) && EXIT_PATH (exit_ob)[1] == '@') |
791 | if (EXIT_PATH (exit_ob) && EXIT_PATH (exit_ob)[1] == '@') |
796 | { |
792 | { |
797 | if (EXIT_PATH (exit_ob)[2] == '!') |
793 | if (EXIT_PATH (exit_ob)[2] == '!') |
798 | { |
794 | { |
… | |
… | |
897 | if (tmp->type == FORCE && tmp->slaying && !strcmp (tmp->slaying, PORTAL_DESTINATION_NAME)) |
893 | if (tmp->type == FORCE && tmp->slaying && !strcmp (tmp->slaying, PORTAL_DESTINATION_NAME)) |
898 | break; |
894 | break; |
899 | } |
895 | } |
900 | if (tmp) |
896 | if (tmp) |
901 | { |
897 | { |
902 | remove_ob (tmp); |
898 | tmp->remove (); |
903 | free_object (tmp); |
899 | tmp->destroy (); |
904 | } |
900 | } |
905 | |
901 | |
906 | strcpy (op->contr->savebed_map, path_combine_and_normalize (exit_ob->map->path, EXIT_PATH (exit_ob))); |
902 | strcpy (op->contr->savebed_map, path_combine_and_normalize (exit_ob->map->path, EXIT_PATH (exit_ob))); |
907 | op->contr->bed_x = EXIT_X (exit_ob), op->contr->bed_y = EXIT_Y (exit_ob); |
903 | op->contr->bed_x = EXIT_X (exit_ob), op->contr->bed_y = EXIT_Y (exit_ob); |
908 | save_player (op, 1); |
904 | save_player (op, 1); |
… | |
… | |
919 | } |
915 | } |
920 | else |
916 | else |
921 | { |
917 | { |
922 | int flags = 0; |
918 | int flags = 0; |
923 | maptile *newmap; |
919 | maptile *newmap; |
924 | |
|
|
925 | |
920 | |
926 | /* Hypothetically, I guess its possible that a standard map matches |
921 | /* Hypothetically, I guess its possible that a standard map matches |
927 | * the localdir, but that seems pretty unlikely - unlikely enough that |
922 | * the localdir, but that seems pretty unlikely - unlikely enough that |
928 | * I'm not going to attempt to try to deal with that possibility. |
923 | * I'm not going to attempt to try to deal with that possibility. |
929 | * We use the fact that when a player saves on a unique map, it prepends |
924 | * We use the fact that when a player saves on a unique map, it prepends |
… | |
… | |
950 | { |
945 | { |
951 | LOG (llevError, "enter_exit: could not load emergency map? Fatal error\n"); |
946 | LOG (llevError, "enter_exit: could not load emergency map? Fatal error\n"); |
952 | abort (); |
947 | abort (); |
953 | } |
948 | } |
954 | } |
949 | } |
|
|
950 | |
955 | enter_map (op, newmap, op->x, op->y); |
951 | enter_map (op, newmap, op->x, op->y); |
956 | } |
952 | } |
957 | } |
953 | } |
958 | |
954 | |
959 | /* |
955 | /* |
… | |
… | |
1102 | process_events (maptile *map) |
1098 | process_events (maptile *map) |
1103 | { |
1099 | { |
1104 | object *op; |
1100 | object *op; |
1105 | |
1101 | |
1106 | static object *marker; |
1102 | static object *marker; |
|
|
1103 | |
1107 | if (!marker) |
1104 | if (!marker) |
1108 | marker = get_object (); |
1105 | marker = object::create (); |
1109 | |
1106 | |
1110 | process_players1 (map); |
1107 | process_players1 (map); |
1111 | |
1108 | |
1112 | marker->active_next = active_objects; |
1109 | marker->active_next = active_objects; |
1113 | |
1110 | |
… | |
… | |
1157 | * around. |
1154 | * around. |
1158 | */ |
1155 | */ |
1159 | if (QUERY_FLAG (op, FLAG_REMOVED) && op->type != PLAYER && op->map && op->map->in_memory != MAP_IN_MEMORY) |
1156 | if (QUERY_FLAG (op, FLAG_REMOVED) && op->type != PLAYER && op->map && op->map->in_memory != MAP_IN_MEMORY) |
1160 | { |
1157 | { |
1161 | LOG (llevError, "BUG: process_events(): Removed object on list\n"); |
1158 | LOG (llevError, "BUG: process_events(): Removed object on list\n"); |
1162 | dump_object (op); |
1159 | char *dump = dump_object (op); |
1163 | LOG (llevError, errmsg); |
1160 | LOG (llevError, dump); |
1164 | free_object (op); |
1161 | free (dump); |
|
|
1162 | op->destroy (); |
1165 | continue; |
1163 | continue; |
1166 | } |
1164 | } |
1167 | |
1165 | |
1168 | if (!op->speed) |
1166 | if (!op->speed) |
1169 | { |
1167 | { |
… | |
… | |
1418 | flush_old_maps (); /* Clears the tmp-files of maps which have reset */ |
1416 | flush_old_maps (); /* Clears the tmp-files of maps which have reset */ |
1419 | |
1417 | |
1420 | if (!(pticks % 2503)) |
1418 | if (!(pticks % 2503)) |
1421 | fix_weight (); /* Hack to fix weightproblems caused by bugs */ |
1419 | fix_weight (); /* Hack to fix weightproblems caused by bugs */ |
1422 | |
1420 | |
1423 | if (!(pticks % 2521)) |
|
|
1424 | metaserver_update (); /* 2500 ticks is about 5 minutes */ |
|
|
1425 | |
|
|
1426 | if (!(pticks % 5003)) |
1421 | if (!(pticks % 5003)) |
1427 | write_book_archive (); |
1422 | write_book_archive (); |
1428 | |
1423 | |
1429 | if (!(pticks % 5009)) |
1424 | if (!(pticks % 5009)) |
1430 | clean_friendly_list (); |
1425 | clean_friendly_list (); |
… | |
… | |
1456 | main (int argc, char **argv) |
1451 | main (int argc, char **argv) |
1457 | { |
1452 | { |
1458 | settings.argc = argc; |
1453 | settings.argc = argc; |
1459 | settings.argv = argv; |
1454 | settings.argv = argv; |
1460 | |
1455 | |
1461 | cfperl_init (); |
|
|
1462 | |
|
|
1463 | init (argc, argv); |
1456 | init (argc, argv); |
1464 | |
1457 | |
1465 | initPlugins (); |
1458 | initPlugins (); |
1466 | |
1459 | |
1467 | for (;;) |
1460 | for (;;) |