--- deliantra/server/common/object.C 2006/12/25 14:43:22 1.83 +++ deliantra/server/common/object.C 2006/12/25 14:54:44 1.84 @@ -1029,7 +1029,7 @@ free (dump); } - map->at (x, y).bottom = above; /* goes on above it. */ + map->at (x, y).bot = above; /* goes on above it. */ } above = 0; @@ -1283,7 +1283,7 @@ if (op->below) op->below->above = op; else - op->ms ().bottom = op; + op->ms ().bot = op; /* since *below* originator, no need to update top */ originator->below = op; @@ -1372,7 +1372,7 @@ op->above->below = op; op->below = NULL; - op->ms ().bottom = op; + op->ms ().bot = op; } else { /* get inserted into the stack above top */ @@ -1409,7 +1409,7 @@ * or just updating the P_NEED_UPDATE for spaces within this area * of effect may be sufficient. */ - if (MAP_DARKNESS (op->map) && (op->glow_radius != 0)) + if (op->map->darkness && (op->glow_radius != 0)) update_all_los (op->map, op->x, op->y); /* updates flags (blocked, alive, no magic, etc) for this map space */ @@ -1705,7 +1705,7 @@ #ifdef DEBUG_LIGHTS LOG (llevDebug, " insert_ob_in_ob(): got %s to insert in map/op\n", op->name); #endif /* DEBUG_LIGHTS */ - if (MAP_DARKNESS (map)) + if (map->darkness) update_all_los (map, x, y); } @@ -1783,7 +1783,7 @@ * Hence, we first go to the top: */ - for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL && tmp->above != NULL; tmp = tmp->above) + for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp && tmp->above; tmp = tmp->above) { /* Trim the search when we find the first other spell effect * this helps performance so that if a space has 50 spell objects, @@ -1848,21 +1848,19 @@ * a matching archetype at the given map and coordinates. * The first matching object is returned, or NULL if none. */ - object * present_arch (const archetype *at, maptile *m, int x, int y) { - object * - tmp; - if (m == NULL || out_of_map (m, x, y)) { LOG (llevError, "Present_arch called outside map.\n"); return NULL; } - for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) + + for (object *tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) if (tmp->arch == at) return tmp; + return NULL; } @@ -1871,21 +1869,19 @@ * a matching type variable at the given map and coordinates. * The first matching object is returned, or NULL if none. */ - object * present (unsigned char type, maptile *m, int x, int y) { - object * - tmp; - if (out_of_map (m, x, y)) { LOG (llevError, "Present called outside map.\n"); return NULL; } - for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) + + for (object *tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) if (tmp->type == type) return tmp; + return NULL; } @@ -1894,16 +1890,13 @@ * a matching type variable in the inventory of the given object. * The first matching object is returned, or NULL if none. */ - object * present_in_ob (unsigned char type, const object *op) { - object * - tmp; - - for (tmp = op->inv; tmp != NULL; tmp = tmp->below) + for (object *tmp = op->inv; tmp != NULL; tmp = tmp->below) if (tmp->type == type) return tmp; + return NULL; } @@ -1924,9 +1917,7 @@ object * present_in_ob_by_name (int type, const char *str, const object *op) { - object *tmp; - - for (tmp = op->inv; tmp; tmp = tmp->below) + for (object *tmp = op->inv; tmp; tmp = tmp->below) if ((type == -1 || tmp->type == type) && (!strcmp (str, tmp->name))) return tmp; @@ -2145,7 +2136,7 @@ max = maxfree[i]; else if (mflags & P_IS_ALIVE) { - for (tmp = ms.bottom; tmp; tmp = tmp->above) + for (tmp = ms.bot; tmp; tmp = tmp->above) if ((tmp->flag [FLAG_MONSTER] || tmp->type == PLAYER) && (tmp != exclude || (tmp->head && tmp->head != exclude))) break;