ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/init.c
(Generate patch)

Comparing deliantra/server/common/init.c (file contents):
Revision 1.2 by root, Fri Feb 3 07:25:24 2006 UTC vs.
Revision 1.5 by pippijn, Fri Apr 21 14:40:29 2006 UTC

1/* 1/*
2 * static char *rcsid_init_c = 2 * static char *rcsid_init_c =
3 * "$Id: init.c,v 1.2 2006/02/03 07:25:24 root Exp $"; 3 * "$Id: init.c,v 1.5 2006/04/21 14:40:29 pippijn Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
54PLAYERDIR, MAPDIR, ARCHETYPES,REGIONS,TREASURES, 54PLAYERDIR, MAPDIR, ARCHETYPES,REGIONS,TREASURES,
55UNIQUE_DIR, TEMPLATE_DIR, 55UNIQUE_DIR, TEMPLATE_DIR,
56TMPDIR, 56TMPDIR,
57STAT_LOSS_ON_DEATH, 57STAT_LOSS_ON_DEATH,
58PK_LUCK_PENALTY, 58PK_LUCK_PENALTY,
59USE_PERMANENT_EXPERIENCE, 59PERMANENT_EXPERIENCE_RATIO,
60DEATH_PENALTY_RATIO,
61DEATH_PENALTY_LEVEL,
60BALANCED_STAT_LOSS, 62BALANCED_STAT_LOSS,
61NOT_PERMADETH, 63NOT_PERMADETH,
62SIMPLE_EXP, 64SIMPLE_EXP,
63RESET_LOCATION_TIME, 65RESET_LOCATION_TIME,
64SET_TITLE, 66SET_TITLE,
98 100
99/* perhaps not the best place for this, but needs to be 101/* perhaps not the best place for this, but needs to be
100 * in some file in the common area so that standalone 102 * in some file in the common area so that standalone
101 * programs, like the random map generator, can be built. 103 * programs, like the random map generator, can be built.
102 */ 104 */
103char *spellpathnames[NRSPELLPATHS] = { 105const char* const spellpathnames[NRSPELLPATHS] = {
104 "Protection", 106 "Protection",
105 "Fire", 107 "Fire",
106 "Frost", 108 "Frost",
107 "Electricity", 109 "Electricity",
108 "Missiles", 110 "Missiles",
234 else if ((logfile=fopen(settings.logfilename, "a"))==NULL) { 236 else if ((logfile=fopen(settings.logfilename, "a"))==NULL) {
235 fprintf(stderr,"Unable to open %s as the logfile - will use stderr instead\n", 237 fprintf(stderr,"Unable to open %s as the logfile - will use stderr instead\n",
236 settings.logfilename); 238 settings.logfilename);
237 logfile = stderr; 239 logfile = stderr;
238 } 240 }
239 setlinebuf(logfile); 241 else {
242 setvbuf(logfile, NULL, _IOLBF, 0);
243 }
240 exiting = 0; 244 exiting = 0;
241 first_player=NULL; 245 first_player=NULL;
242 first_friendly_object=NULL; 246 first_friendly_object=NULL;
243 first_map=NULL; 247 first_map=NULL;
244 first_treasurelist=NULL; 248 first_treasurelist=NULL;
245 first_artifactlist=NULL; 249 first_artifactlist=NULL;
246 first_archetype=NULL; 250 first_archetype=NULL;
251 *first_map_ext_path=0;
247 warn_archetypes=0; 252 warn_archetypes=0;
248 first_map=NULL;
249 nroftreasures = 0; 253 nroftreasures = 0;
250 nrofartifacts = 0; 254 nrofartifacts = 0;
251 nrofallowedstr=0; 255 nrofallowedstr=0;
252 ring_arch = NULL; 256 ring_arch = NULL;
253 amulet_arch = NULL; 257 amulet_arch = NULL;
305 309
306 310
307void init_dynamic (void) { 311void init_dynamic (void) {
308 archetype *at = first_archetype; 312 archetype *at = first_archetype;
309 while (at) { 313 while (at) {
310 if (at->clone.type == MAP && EXIT_PATH (&at->clone)) { 314 if (at->clone.type == MAP) {
315 if (at->clone.race) {
316 strcpy (first_map_ext_path, at->clone.race);
317 }
318 if (EXIT_PATH (&at->clone)) {
311 strcpy (first_map_path, EXIT_PATH (&at->clone)); 319 strcpy (first_map_path, EXIT_PATH (&at->clone));
312 return; 320 return;
321 }
313 } 322 }
314 at = at->next; 323 at = at->next;
315 } 324 }
316 LOG(llevDebug,"You Need a archetype called 'map' and it have to contain start map\n"); 325 LOG(llevDebug,"You Need a archetype called 'map' and it have to contain start map\n");
317 exit (-1); 326 exit (-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines