--- deliantra/server/common/object.C 2006/09/14 17:29:27 1.44 +++ deliantra/server/common/object.C 2006/09/14 18:13:01 1.45 @@ -37,7 +37,6 @@ static UUID uuid; const uint64 UUID_SKIP = 1<<19; -object *objects; /* Pointer to the list of used objects */ object *active_objects; /* List of active objects that need to be processed */ short freearr_x[SIZEOFFREE] = { 0, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1, @@ -449,7 +448,7 @@ { object *op; - for (op = objects; op != NULL; op = op->next) + for (op = object::first; op != NULL; op = op->next) { dump_object (op); fprintf (logfile, "Object %d\n:%s\n", op->count, errmsg); @@ -485,7 +484,7 @@ { object *op; - for (op = objects; op != NULL; op = op->next) + for (op = object::first; op != NULL; op = op->next) if (op->count == i) break; return op; @@ -503,7 +502,7 @@ shstr_cmp str_ (str); object *op; - for (op = objects; op != NULL; op = op->next) + for (op = object::first; op != NULL; op = op->next) if (op->name == str_) break; @@ -897,11 +896,13 @@ update_object (op->more, action); } -static unordered_vector mortals; +object::vector object::mortals; +object::vector object::objects; // not yet used +object *object::first; void object::free_mortals () { - for (unordered_vector::iterator i = mortals.begin (); i != mortals.end ();) + for (AUTODECL (i, mortals.begin ()); i != mortals.end ();) if ((*i)->refcnt) ++i; // further delay freeing else @@ -938,12 +939,12 @@ uuid = gen_uuid (); prev = 0; - next = objects; + next = object::first; - if (objects) - objects->prev = this; + if (object::first) + object::first->prev = this; - objects = this; + object::first = this; } void object::unlink () @@ -951,8 +952,8 @@ //count = 0;//D if (!prev && !next) return;//D - if (this == objects) - objects = next; + if (this == object::first) + object::first = next; /* Remove this object from the list of used objects */ if (prev) prev->next = next; @@ -1065,9 +1066,8 @@ while (op != NULL) { if (op->type == CONTAINER) - { - weight = (signed long) (weight * (100 - op->stats.Str) / 100); - } + weight = (signed long) (weight * (100 - op->stats.Str) / 100); + op->carrying -= weight; op = op->env; } @@ -1085,22 +1085,14 @@ void remove_ob (object *op) { - object * - tmp, * - last = NULL; - object * - otmp; - - tag_t - tag; - int - check_walk_off; - mapstruct * - m; - - sint16 - x, - y; + object *tmp, *last = 0; + object *otmp; + + tag_t tag; + int check_walk_off; + mapstruct *m; + + sint16 x, y; if (QUERY_FLAG (op, FLAG_REMOVED)) return; @@ -1298,7 +1290,7 @@ } } - return NULL; + return 0; } /*