ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.193 by root, Mon Oct 15 17:50:27 2007 UTC vs.
Revision 1.196 by root, Wed Oct 17 22:01:27 2007 UTC

307 ob1->optimise (); 307 ob1->optimise ();
308 ob2->optimise (); 308 ob2->optimise ();
309 309
310 if (ob1->self || ob2->self) 310 if (ob1->self || ob2->self)
311 { 311 {
312 int k1 = ob1->self ? HvTOTALKEYS (SvRV (ob1->self)) : 0; 312 int k1 = ob1->self ? HvTOTALKEYS (ob1->self) : 0;
313 int k2 = ob2->self ? HvTOTALKEYS (SvRV (ob2->self)) : 0; 313 int k2 = ob2->self ? HvTOTALKEYS (ob2->self) : 0;
314 314
315 if (k1 != k2) 315 if (k1 != k2)
316 return 0; 316 return 0;
317 else if (k1 == 0) 317 else if (k1 == 0)
318 return 1; 318 return 1;
1150merge_ob (object *op, object *top) 1150merge_ob (object *op, object *top)
1151{ 1151{
1152 if (!op->nrof) 1152 if (!op->nrof)
1153 return 0; 1153 return 0;
1154 1154
1155 if (top) 1155 if (!top)
1156 for (top = op; top && top->above; top = top->above) 1156 for (top = op; top && top->above; top = top->above)
1157 ; 1157 ;
1158 1158
1159 for (; top; top = top->below) 1159 for (; top; top = top->below)
1160 { 1160 {
1983 * to search (see the freearr_x/y[] definition). 1983 * to search (see the freearr_x/y[] definition).
1984 * It returns a random choice among the alternatives found. 1984 * It returns a random choice among the alternatives found.
1985 * start and stop are where to start relative to the free_arr array (1,9 1985 * start and stop are where to start relative to the free_arr array (1,9
1986 * does all 4 immediate directions). This returns the index into the 1986 * does all 4 immediate directions). This returns the index into the
1987 * array of the free spot, -1 if no spot available (dir 0 = x,y) 1987 * array of the free spot, -1 if no spot available (dir 0 = x,y)
1988 * Note - this only checks to see if there is space for the head of the
1989 * object - if it is a multispace object, this should be called for all
1990 * pieces.
1991 * Note2: This function does correctly handle tiled maps, but does not 1988 * Note: This function does correctly handle tiled maps, but does not
1992 * inform the caller. However, insert_ob_in_map will update as 1989 * inform the caller. However, insert_ob_in_map will update as
1993 * necessary, so the caller shouldn't need to do any special work. 1990 * necessary, so the caller shouldn't need to do any special work.
1994 * Note - updated to take an object instead of archetype - this is necessary 1991 * Note - updated to take an object instead of archetype - this is necessary
1995 * because arch_blocked (now ob_blocked) needs to know the movement type 1992 * because arch_blocked (now ob_blocked) needs to know the movement type
1996 * to know if the space in question will block the object. We can't use 1993 * to know if the space in question will block the object. We can't use
2041 2038
2042 /* Note it is intentional that we check ob - the movement type of the 2039 /* Note it is intentional that we check ob - the movement type of the
2043 * head of the object should correspond for the entire object. 2040 * head of the object should correspond for the entire object.
2044 */ 2041 */
2045 if (OB_TYPE_MOVE_BLOCK (ob, ms.move_block)) 2042 if (OB_TYPE_MOVE_BLOCK (ob, ms.move_block))
2043 continue;
2044
2045 if (ob->blocked (m, pos.x, pos.y))
2046 continue; 2046 continue;
2047 2047
2048 altern [index++] = i; 2048 altern [index++] = i;
2049 } 2049 }
2050 2050

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines