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.36 by root, Tue Sep 12 19:20:06 2006 UTC vs.
Revision 1.37 by root, Tue Sep 12 20:55:40 2006 UTC

254 { 254 {
255 if (inv->inv) 255 if (inv->inv)
256 sum_weight (inv); 256 sum_weight (inv);
257 sum += inv->carrying + inv->weight * (inv->nrof ? inv->nrof : 1); 257 sum += inv->carrying + inv->weight * (inv->nrof ? inv->nrof : 1);
258 } 258 }
259
259 if (op->type == CONTAINER && op->stats.Str) 260 if (op->type == CONTAINER && op->stats.Str)
260 sum = (sum * (100 - op->stats.Str)) / 100; 261 sum = (sum * (100 - op->stats.Str)) / 100;
262
261 if (op->carrying != sum) 263 if (op->carrying != sum)
262 op->carrying = sum; 264 op->carrying = sum;
265
263 return sum; 266 return sum;
264} 267}
265 268
266/** 269/**
267 * Return the outermost environment object for a given object. 270 * Return the outermost environment object for a given object.
836 if (op->more != NULL) 839 if (op->more != NULL)
837 update_object (op->more, action); 840 update_object (op->more, action);
838} 841}
839 842
840static unordered_vector<object *> mortals; 843static unordered_vector<object *> mortals;
841static std::vector<object *> freed; 844static std::vector<object *, slice_allocator <object *> > freed;
842 845
843void object::free_mortals () 846void object::free_mortals ()
844{ 847{
845 for (unordered_vector<object *>::iterator i = mortals.begin (); i != mortals.end ();) 848 for (unordered_vector<object *>::iterator i = mortals.begin (); i != mortals.end ();)
846 if ((*i)->refcnt) 849 if ((*i)->refcnt)
1222 * This function goes through all objects below and including top, and 1225 * This function goes through all objects below and including top, and
1223 * merges op to the first matching object. 1226 * merges op to the first matching object.
1224 * If top is NULL, it is calculated. 1227 * If top is NULL, it is calculated.
1225 * Returns pointer to object if it succeded in the merge, otherwise NULL 1228 * Returns pointer to object if it succeded in the merge, otherwise NULL
1226 */ 1229 */
1227
1228object * 1230object *
1229merge_ob (object *op, object *top) 1231merge_ob (object *op, object *top)
1230{ 1232{
1231 if (!op->nrof) 1233 if (!op->nrof)
1232 return 0; 1234 return 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines