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.192 by root, Fri Oct 12 19:13:25 2007 UTC vs.
Revision 1.195 by root, Wed Oct 17 19:08:12 2007 UTC

254 /* This is really a spellbook check - really, we should 254 /* This is really a spellbook check - really, we should
255 * check all objects in the inventory. 255 * check all objects in the inventory.
256 */ 256 */
257 if (ob1->inv || ob2->inv) 257 if (ob1->inv || ob2->inv)
258 { 258 {
259 /* if one object has inventory but the other doesn't, not equiv */ 259 if (!(ob1->inv && ob2->inv))
260 if ((ob1->inv && !ob2->inv) || (ob2->inv && !ob1->inv)) 260 return 0; /* inventories differ in length */
261 return 0;
262 261
263 /* Now check to see if the two inventory objects could merge */ 262 if (ob1->inv->below || ob2->inv->below)
263 return 0; /* more than one object in inv */
264
264 if (!object::can_merge (ob1->inv, ob2->inv)) 265 if (!object::can_merge (ob1->inv, ob2->inv))
265 return 0; 266 return 0; /* inventory objexts differ */
266 267
267 /* inventory ok - still need to check rest of this object to see 268 /* inventory ok - still need to check rest of this object to see
268 * if it is valid. 269 * if it is valid.
269 */ 270 */
270 } 271 }
306 ob1->optimise (); 307 ob1->optimise ();
307 ob2->optimise (); 308 ob2->optimise ();
308 309
309 if (ob1->self || ob2->self) 310 if (ob1->self || ob2->self)
310 { 311 {
311 int k1 = ob1->self ? HvTOTALKEYS (SvRV (ob1->self)) : 0; 312 int k1 = ob1->self ? HvTOTALKEYS (ob1->self) : 0;
312 int k2 = ob2->self ? HvTOTALKEYS (SvRV (ob2->self)) : 0; 313 int k2 = ob2->self ? HvTOTALKEYS (ob2->self) : 0;
313 314
314 if (k1 != k2) 315 if (k1 != k2)
315 return 0; 316 return 0;
316 else if (k1 == 0) 317 else if (k1 == 0)
317 return 1; 318 return 1;
1149merge_ob (object *op, object *top) 1150merge_ob (object *op, object *top)
1150{ 1151{
1151 if (!op->nrof) 1152 if (!op->nrof)
1152 return 0; 1153 return 0;
1153 1154
1154 if (top) 1155 if (!top)
1155 for (top = op; top && top->above; top = top->above) 1156 for (top = op; top && top->above; top = top->above)
1156 ; 1157 ;
1157 1158
1158 for (; top; top = top->below) 1159 for (; top; top = top->below)
1159 { 1160 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines