--- deliantra/server/random_maps/treasure.C 2010/03/28 22:29:50 1.51 +++ deliantra/server/random_maps/treasure.C 2010/06/26 22:10:18 1.54 @@ -111,7 +111,7 @@ { kx = rmg_rndm (RP->Xsize - 2) + 1; ky = rmg_rndm (RP->Ysize - 2) + 1; - freeindex = find_free_spot (the_key, map, kx, ky, 1, SIZEOFFREE1 + 1); + freeindex = rmg_find_free_spot (the_key, map, kx, ky, 1, SIZEOFFREE1 + 1); } // can freeindex ever be < 0? @@ -194,7 +194,7 @@ treasureoptions (may be 0 for random choices or positive) */ void -place_treasure (maptile *map, char **layout, char *treasure_style, int treasureoptions, random_map_params *RP) +place_treasure (maptile *map, char **layout, const char *treasure_style, int treasureoptions, random_map_params *RP) { int num_treasures; @@ -227,7 +227,7 @@ return; /* get the style map */ - maptile *style_map = find_style ("/styles/treasurestyles", treasure_style, -1); + maptile *style_map = find_style ("/styles/treasurestyles", treasure_style, RP->difficulty); if (!style_map) { @@ -381,7 +381,7 @@ /* stick a trap in the chest if required */ if (treasureoptions & TRAPPED) { - maptile *trap_map = find_style ("/styles/trapstyles", "traps", -1); + maptile *trap_map = find_style ("/styles/trapstyles", "traps", RP->difficulty); if (trap_map) { @@ -436,8 +436,8 @@ { object *the_monster = GET_MAP_OB (map, lx, ly); - for (; the_monster != NULL && (!QUERY_FLAG (the_monster, FLAG_MONSTER)); the_monster = the_monster->above); - if (the_monster && QUERY_FLAG (the_monster, FLAG_MONSTER)) + for (; the_monster != NULL && (!the_monster->flag [FLAG_MONSTER]); the_monster = the_monster->above); + if (the_monster && the_monster->flag [FLAG_MONSTER]) return the_monster; } } @@ -475,8 +475,8 @@ object *the_monster = GET_MAP_OB (map, x, y); /* check off this point */ - for (; the_monster != NULL && (!QUERY_FLAG (the_monster, FLAG_ALIVE)); the_monster = the_monster->above); - if (the_monster && QUERY_FLAG (the_monster, FLAG_ALIVE)) + for (; the_monster != NULL && (!the_monster->flag [FLAG_ALIVE]); the_monster = the_monster->above); + if (the_monster && the_monster->flag [FLAG_ALIVE]) { theMonsterToFind = the_monster; return theMonsterToFind; @@ -656,7 +656,7 @@ } } /* give up and return the closest free spot. */ - i = find_free_spot (archetype::find (shstr_chest), map, x, y, 1, SIZEOFFREE1 + 1); + i = rmg_find_free_spot (archetype::find (shstr_chest), map, x, y, 1, SIZEOFFREE1 + 1); if (i != -1) {