ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/style.C
(Generate patch)

Comparing deliantra/server/random_maps/style.C (file contents):
Revision 1.5 by root, Sat Sep 16 22:24:13 2006 UTC vs.
Revision 1.9 by root, Mon Dec 25 14:43:23 2006 UTC

22*/ 22*/
23 23
24 24
25#include <global.h> 25#include <global.h>
26#include <random_map.h> 26#include <random_map.h>
27#ifndef WIN32 /* ---win32 exclude headers */
28# include <dirent.h> 27#include <dirent.h>
29# include <sys/stat.h> 28#include <sys/stat.h>
30# include <unistd.h> 29#include <unistd.h>
31# include "../include/autoconf.h" 30#include "../include/autoconf.h"
32#endif /* win32 */
33 31
34 32
35static int 33static int
36pointer_strcmp (const void *p1, const void *p2) 34pointer_strcmp (const void *p1, const void *p2)
37{ 35{
83 if (entries == entry_size) 81 if (entries == entry_size)
84 { 82 {
85 entry_size += 10; 83 entry_size += 10;
86 rn = (char **) realloc (rn, sizeof (char *) * entry_size); 84 rn = (char **) realloc (rn, sizeof (char *) * entry_size);
87 } 85 }
88 rn[entries] = strdup_local (d->d_name); 86 rn[entries] = strdup (d->d_name);
89 entries++; 87 entries++;
90 88
91 } 89 }
92 (void) closedir (dp); 90 (void) closedir (dp);
93 91
267 * any difference, but this seems clearer to me. 265 * any difference, but this seems clearer to me.
268 */ 266 */
269 do 267 do
270 { 268 {
271 limit++; 269 limit++;
272 x = RANDOM () % MAP_WIDTH (style); 270 x = RANDOM () % style->width;
273 y = RANDOM () % MAP_HEIGHT (style); 271 y = RANDOM () % style->height;
274 new_obj = get_map_ob (style, x, y); 272 new_obj = GET_MAP_OB (style, x, y);
275 } 273 }
276 while (new_obj == NULL && limit < 1000); 274 while (new_obj == NULL && limit < 1000);
277 if (new_obj->head) 275 if (new_obj->head)
278 return new_obj->head; 276 return new_obj->head;
279 else 277 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines