… | |
… | |
249 | * about pending objects. |
249 | * about pending objects. |
250 | */ |
250 | */ |
251 | remove_all_pets (newmap); |
251 | remove_all_pets (newmap); |
252 | } |
252 | } |
253 | |
253 | |
254 | /* clean_path takes a path and replaces all / with _ |
|
|
255 | * We do a strcpy so that we do not change the original string. |
|
|
256 | */ |
|
|
257 | char * |
|
|
258 | clean_path (const char *file) |
|
|
259 | { |
|
|
260 | static char newpath[MAX_BUF], *cp; |
|
|
261 | assign (newpath, file); |
|
|
262 | |
|
|
263 | for (cp = newpath; *cp != '\0'; cp++) |
|
|
264 | if (*cp == '/') |
|
|
265 | *cp = '_'; |
|
|
266 | |
|
|
267 | return newpath; |
|
|
268 | } |
|
|
269 | |
|
|
270 | /* unclean_path takes a path and replaces all _ with / |
|
|
271 | * This basically undoes clean path. |
|
|
272 | * We do a strcpy so that we do not change the original string. |
|
|
273 | * We are smart enough to start after the last / in case we |
|
|
274 | * are getting passed a string that points to a unique map |
|
|
275 | * path. |
|
|
276 | */ |
|
|
277 | char * |
|
|
278 | unclean_path (const char *src) |
|
|
279 | { |
|
|
280 | static char newpath[MAX_BUF], *cp; |
|
|
281 | |
|
|
282 | cp = strrchr (src, '/'); |
|
|
283 | assign (newpath, cp ? cp + 1 : src); |
|
|
284 | |
|
|
285 | for (cp = newpath; *cp != '\0'; cp++) |
|
|
286 | if (*cp == '_') |
|
|
287 | *cp = '/'; |
|
|
288 | |
|
|
289 | return newpath; |
|
|
290 | } |
|
|
291 | |
|
|
292 | /* process_players1 and process_players2 do all the player related stuff. |
254 | /* process_players1 and process_players2 do all the player related stuff. |
293 | * I moved it out of process events and process_map. This was to some |
255 | * I moved it out of process events and process_map. This was to some |
294 | * extent for debugging as well as to get a better idea of the time used |
256 | * extent for debugging as well as to get a better idea of the time used |
295 | * by the various functions. process_players1() does the processing before |
257 | * by the various functions. process_players1() does the processing before |
296 | * objects have been updated, process_players2() does the processing that |
258 | * objects have been updated, process_players2() does the processing that |
… | |
… | |
729 | initPlugins (); |
691 | initPlugins (); |
730 | |
692 | |
731 | for (;;) |
693 | for (;;) |
732 | cfperl_main (); |
694 | cfperl_main (); |
733 | |
695 | |
734 | // unreached |
|
|
735 | cleanup (); |
696 | cleanup (true); |
736 | |
|
|
737 | return 0; |
|
|
738 | } |
697 | } |
|
|
698 | |