--- deliantra/server/random_maps/standalone.C 2006/09/10 16:06:37 1.3 +++ deliantra/server/random_maps/standalone.C 2006/12/30 18:45:28 1.11 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_standalone_c = - * "$Id: standalone.C,v 1.3 2006/09/10 16:06:37 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The authors can be reached via e-mail at crossfire-devel@real-time.com + The authors can be reached via e-mail at */ #define LO_NEWFILE 2 @@ -43,8 +37,8 @@ main (int argc, char *argv[]) { char InFileName[1024], OutFileName[1024]; - mapstruct *newMap; - RMParms rp; + maptile *newMap; + random_map_params rp; FILE *fp; if (argc < 3) @@ -63,7 +57,7 @@ init_readable (); init_gods (); - memset (&rp, 0, sizeof (RMParms)); + memset (&rp, 0, sizeof (random_map_params)); rp.Xsize = -1; rp.Ysize = -1; if ((fp = fopen (InFileName, "r")) == NULL) @@ -79,7 +73,7 @@ } void -set_map_timeout (mapstruct *) +set_map_timeout (maptile *) { } /* doesn't need to do anything */ @@ -97,7 +91,7 @@ switch (op->type) { case SHOP_FLOOR: - if (!HAS_RANDOM_ITEMS (op)) + if (!op->has_random_items ()) return 0; do { @@ -107,7 +101,7 @@ return 0; if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) { - free_object (tmp); + tmp->destroy (); tmp = NULL; } } @@ -121,12 +115,12 @@ break; case TREASURE: - if (HAS_RANDOM_ITEMS (op)) + if (op->has_random_items ()) while ((op->stats.hp--) > 0) create_treasure (op->randomitems, op, GT_ENVIRONMENT, op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0); - remove_ob (op); - free_object (op); + op->remove (); + op->destroy (); break; } @@ -140,14 +134,14 @@ */ void -fix_auto_apply (mapstruct *m) +fix_auto_apply (maptile *m) { object *tmp, *above = NULL; int x, y; - for (x = 0; x < MAP_WIDTH (m); x++) - for (y = 0; y < MAP_HEIGHT (m); y++) - for (tmp = get_map_ob (m, x, y); tmp != NULL; tmp = above) + for (x = 0; x < m->width; x++) + for (y = 0; y < m->height; y++) + for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = above) { above = tmp->above; @@ -155,7 +149,7 @@ auto_apply (tmp); else if (tmp->type == TREASURE) { - if (HAS_RANDOM_ITEMS (tmp)) + if (tmp->has_random_items ()) while ((tmp->stats.hp--) > 0) create_treasure (tmp->randomitems, tmp, 0, m->difficulty, 0); } @@ -163,17 +157,17 @@ { if (tmp->type == CONTAINER) { - if (HAS_RANDOM_ITEMS (tmp)) + if (tmp->has_random_items ()) while ((tmp->stats.hp--) > 0) create_treasure (tmp->randomitems, tmp, 0, m->difficulty, 0); } - else if (HAS_RANDOM_ITEMS (tmp)) + else if (tmp->has_random_items ()) create_treasure (tmp->randomitems, tmp, GT_APPLY, m->difficulty, 0); } } - for (x = 0; x < MAP_WIDTH (m); x++) - for (y = 0; y < MAP_HEIGHT (m); y++) - for (tmp = get_map_ob (m, x, y); tmp != NULL; tmp = tmp->above) + for (x = 0; x < m->width; x++) + for (y = 0; y < m->height; y++) + for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) if (tmp->above && (tmp->type == TRIGGER_BUTTON || tmp->type == TRIGGER_PEDESTAL)) check_trigger (tmp, tmp->above); } @@ -191,7 +185,7 @@ } void -new_info_map (int color, mapstruct *map, const char *str) +new_info_map (int color, maptile *map, const char *str) { fprintf (logfile, "new_info_map: %s\n", str); } @@ -247,7 +241,7 @@ } void -set_darkness_map (mapstruct *m) +set_darkness_map (maptile *m) { }