--- deliantra/server/common/object.C 2007/10/16 00:30:24 1.194 +++ deliantra/server/common/object.C 2007/10/17 22:04:31 1.197 @@ -309,8 +309,8 @@ if (ob1->self || ob2->self) { - int k1 = ob1->self ? HvTOTALKEYS (SvRV (ob1->self)) : 0; - int k2 = ob2->self ? HvTOTALKEYS (SvRV (ob2->self)) : 0; + int k1 = ob1->self ? HvTOTALKEYS (ob1->self) : 0; + int k2 = ob2->self ? HvTOTALKEYS (ob2->self) : 0; if (k1 != k2) return 0; @@ -1954,12 +1954,11 @@ void flag_inv (object *op, int flag) { - if (op->inv) - for (object *tmp = op->inv; tmp != NULL; tmp = tmp->below) - { - SET_FLAG (tmp, flag); - flag_inv (tmp, flag); - } + for (object *tmp = op->inv; tmp; tmp = tmp->below) + { + SET_FLAG (tmp, flag); + flag_inv (tmp, flag); + } } /* @@ -1968,12 +1967,11 @@ void unflag_inv (object *op, int flag) { - if (op->inv) - for (object *tmp = op->inv; tmp != NULL; tmp = tmp->below) - { - CLEAR_FLAG (tmp, flag); - unflag_inv (tmp, flag); - } + for (object *tmp = op->inv; tmp; tmp = tmp->below) + { + CLEAR_FLAG (tmp, flag); + unflag_inv (tmp, flag); + } } /* @@ -1985,10 +1983,7 @@ * start and stop are where to start relative to the free_arr array (1,9 * does all 4 immediate directions). This returns the index into the * array of the free spot, -1 if no spot available (dir 0 = x,y) - * Note - this only checks to see if there is space for the head of the - * object - if it is a multispace object, this should be called for all - * pieces. - * Note2: This function does correctly handle tiled maps, but does not + * Note: This function does correctly handle tiled maps, but does not * inform the caller. However, insert_ob_in_map will update as * necessary, so the caller shouldn't need to do any special work. * Note - updated to take an object instead of archetype - this is necessary @@ -2045,6 +2040,9 @@ if (OB_TYPE_MOVE_BLOCK (ob, ms.move_block)) continue; + if (ob->blocked (m, pos.x, pos.y)) + continue; + altern [index++] = i; }