1 | /* |
1 | /* |
2 | * static char *rcsid_map_c = |
2 | * static char *rcsid_map_c = |
3 | * "$Id: region.c,v 1.1.1.2 2006/02/22 18:01:23 elmex Exp $"; |
3 | * "$Id: region.c,v 1.4 2006/08/13 17:16:00 elmex dead $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
226 | int comp; |
226 | int comp; |
227 | |
227 | |
228 | if(first_region!=NULL) /* Only do this once */ |
228 | if(first_region!=NULL) /* Only do this once */ |
229 | return; |
229 | return; |
230 | |
230 | |
231 | sprintf(filename,"%s/%s",settings.datadir,settings.regions); |
231 | sprintf(filename,"%s/%s/%s",settings.datadir,settings.mapdir,settings.regions); |
232 | LOG(llevDebug,"Reading regions from %s...\n",filename); |
232 | LOG(llevDebug,"Reading regions from %s...\n",filename); |
233 | if((fp=open_and_uncompress(filename,0,&comp))==NULL) { |
233 | if((fp=open_and_uncompress(filename,0,&comp))==NULL) { |
234 | LOG(llevError," Can't open regions file %s in init_regions.\n", filename); |
234 | LOG(llevError," Can't open regions file %s in init_regions.\n", filename); |
235 | return; |
235 | return; |
236 | } |
236 | } |
… | |
… | |
253 | |
253 | |
254 | new=(region *)CALLOC(1,sizeof(region)); |
254 | new=(region *)CALLOC(1,sizeof(region)); |
255 | if(new==NULL) |
255 | if(new==NULL) |
256 | fatal(OUT_OF_MEMORY); |
256 | fatal(OUT_OF_MEMORY); |
257 | |
257 | |
258 | memset(new, sizeof(region), '\0'); |
258 | memset(new, '\0', sizeof(region)); |
259 | |
259 | |
260 | return new; |
260 | return new; |
261 | } |
261 | } |
262 | |
262 | |
263 | /* |
263 | /* |
264 | * Reads/parses the region file, and copies into a linked list |
264 | * Reads/parses the region file, and copies into a linked list |