… | |
… | |
445 | { |
445 | { |
446 | while (op) |
446 | while (op) |
447 | { |
447 | { |
448 | // adjust by actual difference to account for rounding errors |
448 | // adjust by actual difference to account for rounding errors |
449 | // i.e. (w2 - w1) / f != w2 / f - w1 / f and the latter is correct |
449 | // i.e. (w2 - w1) / f != w2 / f - w1 / f and the latter is correct |
450 | weight = weight_adjust_for (op, op->carrying) |
450 | weight = weight_adjust_for (op, op->carrying + weight) |
451 | - weight_adjust_for (op, op->carrying - weight); |
451 | - weight_adjust_for (op, op->carrying); |
452 | |
452 | |
453 | if (!weight) |
453 | if (!weight) |
454 | return; |
454 | return; |
455 | |
455 | |
456 | op->carrying += weight; |
456 | op->carrying += weight; |
… | |
… | |
484 | sum = weight_adjust_for (this, sum); |
484 | sum = weight_adjust_for (this, sum); |
485 | |
485 | |
486 | if (sum != carrying) |
486 | if (sum != carrying) |
487 | { |
487 | { |
488 | if (carrying != sum)//D |
488 | if (carrying != sum)//D |
489 | LOG (llevDebug, "updating weight got %ld, expected %ld (%s)\n", |
489 | LOG (llevDebug, "updating carrying got %ld, expected %ld (%s)\n", |
490 | (long long)sum, (long long)carrying, debug_desc ()); |
490 | (long long)sum, (long long)carrying, debug_desc ()); |
491 | |
491 | |
492 | carrying = sum; |
492 | carrying = sum; |
493 | |
493 | |
494 | if (object *pl = visible_to ()) |
494 | if (object *pl = visible_to ()) |
… | |
… | |
1575 | if (!(flag & INS_NO_WALK_ON) && op->is_head ()) |
1575 | if (!(flag & INS_NO_WALK_ON) && op->is_head ()) |
1576 | { |
1576 | { |
1577 | if (check_move_on (op, originator)) |
1577 | if (check_move_on (op, originator)) |
1578 | return 0; |
1578 | return 0; |
1579 | |
1579 | |
1580 | /* If we are a multi part object, lets work our way through the check |
1580 | /* If we are a multi part object, let's work our way through the check |
1581 | * walk on's. |
1581 | * walk on's. |
1582 | */ |
1582 | */ |
1583 | for (object *tmp = op->more; tmp; tmp = tmp->more) |
1583 | for (object *tmp = op->more; tmp; tmp = tmp->more) |
1584 | if (check_move_on (tmp, originator)) |
1584 | if (check_move_on (tmp, originator)) |
1585 | return 0; |
1585 | return 0; |