… | |
… | |
221 | SET_FLAG (ob1, FLAG_BEEN_APPLIED); |
221 | SET_FLAG (ob1, FLAG_BEEN_APPLIED); |
222 | |
222 | |
223 | if (QUERY_FLAG (ob2, FLAG_IDENTIFIED)) |
223 | if (QUERY_FLAG (ob2, FLAG_IDENTIFIED)) |
224 | SET_FLAG (ob2, FLAG_BEEN_APPLIED); |
224 | SET_FLAG (ob2, FLAG_BEEN_APPLIED); |
225 | |
225 | |
226 | if ((ob1->flags ^ ob2->flags).reset (FLAG_INV_LOCKED).reset (FLAG_CLIENT_SENT).any () |
226 | if ((ob1->flag ^ ob2->flag).reset (FLAG_INV_LOCKED).reset (FLAG_CLIENT_SENT).any () |
227 | || ob1->arch != ob2->arch |
227 | || ob1->arch != ob2->arch |
228 | || ob1->name != ob2->name |
228 | || ob1->name != ob2->name |
229 | || ob1->title != ob2->title |
229 | || ob1->title != ob2->title |
230 | || ob1->msg != ob2->msg |
230 | || ob1->msg != ob2->msg |
231 | || ob1->weight != ob2->weight |
231 | || ob1->weight != ob2->weight |
… | |
… | |
482 | { |
482 | { |
483 | bool is_freed = QUERY_FLAG (dst, FLAG_FREED); |
483 | bool is_freed = QUERY_FLAG (dst, FLAG_FREED); |
484 | bool is_removed = QUERY_FLAG (dst, FLAG_REMOVED); |
484 | bool is_removed = QUERY_FLAG (dst, FLAG_REMOVED); |
485 | |
485 | |
486 | *(object_copy *)dst = *this; |
486 | *(object_copy *)dst = *this; |
487 | *(object_pod *)dst = *this; |
|
|
488 | |
487 | |
489 | if (self || cb) |
488 | if (self || cb) |
490 | INVOKE_OBJECT (CLONE, this, ARG_OBJECT (dst)); |
489 | INVOKE_OBJECT (CLONE, this, ARG_OBJECT (dst)); |
491 | |
490 | |
492 | if (is_freed) |
491 | if (is_freed) |
… | |
… | |
1506 | |
1505 | |
1507 | object * |
1506 | object * |
1508 | decrease_ob_nr (object *op, uint32 i) |
1507 | decrease_ob_nr (object *op, uint32 i) |
1509 | { |
1508 | { |
1510 | object *tmp; |
1509 | object *tmp; |
1511 | player *pl; |
|
|
1512 | |
1510 | |
1513 | if (i == 0) /* objects with op->nrof require this check */ |
1511 | if (i == 0) /* objects with op->nrof require this check */ |
1514 | return op; |
1512 | return op; |
1515 | |
1513 | |
1516 | if (i > op->nrof) |
1514 | if (i > op->nrof) |
… | |
… | |
1529 | * IMO, searching through all the players will mostly |
1527 | * IMO, searching through all the players will mostly |
1530 | * likely be quicker than following op->env to the map, |
1528 | * likely be quicker than following op->env to the map, |
1531 | * and then searching the map for a player. |
1529 | * and then searching the map for a player. |
1532 | */ |
1530 | */ |
1533 | if (!tmp) |
1531 | if (!tmp) |
1534 | { |
1532 | for_all_players (pl) |
1535 | for (pl = first_player; pl; pl = pl->next) |
|
|
1536 | if (pl->ob->container == op->env) |
1533 | if (pl->ob->container == op->env) |
1537 | { |
1534 | { |
1538 | tmp = pl->ob; |
1535 | tmp = pl->ob; |
1539 | break; |
1536 | break; |
1540 | } |
1537 | } |
1541 | } |
|
|
1542 | |
1538 | |
1543 | if (i < op->nrof) |
1539 | if (i < op->nrof) |
1544 | { |
1540 | { |
1545 | sub_weight (op->env, op->weight * i); |
1541 | sub_weight (op->env, op->weight * i); |
1546 | op->nrof -= i; |
1542 | op->nrof -= i; |