… | |
… | |
1136 | { |
1136 | { |
1137 | CLEAR_FLAG (this, FLAG_APPLIED); |
1137 | CLEAR_FLAG (this, FLAG_APPLIED); |
1138 | tmp->container = 0; |
1138 | tmp->container = 0; |
1139 | } |
1139 | } |
1140 | |
1140 | |
1141 | tmp->contr->socket->update_look = 1; |
1141 | tmp->contr->socket->floorbox_update (); |
1142 | } |
1142 | } |
1143 | |
1143 | |
1144 | /* See if player moving off should effect something */ |
1144 | /* See if player moving off should effect something */ |
1145 | if (check_walk_off |
1145 | if (check_walk_off |
1146 | && ((move_type & tmp->move_off) |
1146 | && ((move_type & tmp->move_off) |
… | |
… | |
1483 | * it, so save a few ticks and start from there. |
1483 | * it, so save a few ticks and start from there. |
1484 | */ |
1484 | */ |
1485 | if (!(flag & INS_MAP_LOAD)) |
1485 | if (!(flag & INS_MAP_LOAD)) |
1486 | for (tmp = floor ? floor : GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
1486 | for (tmp = floor ? floor : GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
1487 | if (tmp->type == PLAYER) |
1487 | if (tmp->type == PLAYER) |
1488 | tmp->contr->socket->update_look = 1; |
1488 | tmp->contr->socket->floorbox_update (); |
1489 | |
1489 | |
1490 | /* If this object glows, it may affect lighting conditions that are |
1490 | /* If this object glows, it may affect lighting conditions that are |
1491 | * visible to others on this map. But update_all_los is really |
1491 | * visible to others on this map. But update_all_los is really |
1492 | * an inefficient way to do this, as it means los for all players |
1492 | * an inefficient way to do this, as it means los for all players |
1493 | * on the map will get recalculated. The players could very well |
1493 | * on the map will get recalculated. The players could very well |
… | |
… | |
1501 | |
1501 | |
1502 | /* updates flags (blocked, alive, no magic, etc) for this map space */ |
1502 | /* updates flags (blocked, alive, no magic, etc) for this map space */ |
1503 | update_object (op, UP_OBJ_INSERT); |
1503 | update_object (op, UP_OBJ_INSERT); |
1504 | |
1504 | |
1505 | /* Don't know if moving this to the end will break anything. However, |
1505 | /* Don't know if moving this to the end will break anything. However, |
1506 | * we want to have update_look set above before calling this. |
1506 | * we want to have floorbox_update called before calling this. |
1507 | * |
1507 | * |
1508 | * check_move_on() must be after this because code called from |
1508 | * check_move_on() must be after this because code called from |
1509 | * check_move_on() depends on correct map flags (so functions like |
1509 | * check_move_on() depends on correct map flags (so functions like |
1510 | * blocked() and wall() work properly), and these flags are updated by |
1510 | * blocked() and wall() work properly), and these flags are updated by |
1511 | * update_object(). |
1511 | * update_object(). |
… | |
… | |
1614 | if (i > op->nrof) |
1614 | if (i > op->nrof) |
1615 | i = op->nrof; |
1615 | i = op->nrof; |
1616 | |
1616 | |
1617 | if (QUERY_FLAG (op, FLAG_REMOVED)) |
1617 | if (QUERY_FLAG (op, FLAG_REMOVED)) |
1618 | op->nrof -= i; |
1618 | op->nrof -= i; |
1619 | else if (op->env != NULL) |
1619 | else if (op->env) |
1620 | { |
1620 | { |
1621 | /* is this object in the players inventory, or sub container |
1621 | /* is this object in the players inventory, or sub container |
1622 | * therein? |
1622 | * therein? |
1623 | */ |
1623 | */ |
1624 | tmp = is_player_inv (op->env); |
1624 | tmp = is_player_inv (op->env); |
… | |
… | |
1630 | */ |
1630 | */ |
1631 | if (!tmp) |
1631 | if (!tmp) |
1632 | { |
1632 | { |
1633 | for (pl = first_player; pl; pl = pl->next) |
1633 | for (pl = first_player; pl; pl = pl->next) |
1634 | if (pl->ob->container == op->env) |
1634 | if (pl->ob->container == op->env) |
|
|
1635 | { |
|
|
1636 | tmp = pl->ob; |
1635 | break; |
1637 | break; |
1636 | if (pl) |
1638 | } |
1637 | tmp = pl->ob; |
|
|
1638 | else |
|
|
1639 | tmp = NULL; |
|
|
1640 | } |
1639 | } |
1641 | |
1640 | |
1642 | if (i < op->nrof) |
1641 | if (i < op->nrof) |
1643 | { |
1642 | { |
1644 | sub_weight (op->env, op->weight * i); |
1643 | sub_weight (op->env, op->weight * i); |
1645 | op->nrof -= i; |
1644 | op->nrof -= i; |
1646 | if (tmp) |
1645 | if (tmp) |
1647 | { |
|
|
1648 | esrv_send_item (tmp, op); |
1646 | esrv_send_item (tmp, op); |
1649 | } |
|
|
1650 | } |
1647 | } |
1651 | else |
1648 | else |
1652 | { |
1649 | { |
1653 | op->remove (); |
1650 | op->remove (); |
1654 | op->nrof = 0; |
1651 | op->nrof = 0; |
1655 | if (tmp) |
1652 | if (tmp) |
1656 | { |
|
|
1657 | esrv_del_item (tmp->contr, op->count); |
1653 | esrv_del_item (tmp->contr, op->count); |
1658 | } |
|
|
1659 | } |
1654 | } |
1660 | } |
1655 | } |
1661 | else |
1656 | else |
1662 | { |
1657 | { |
1663 | object *above = op->above; |
1658 | object *above = op->above; |
… | |
… | |
1669 | op->remove (); |
1664 | op->remove (); |
1670 | op->nrof = 0; |
1665 | op->nrof = 0; |
1671 | } |
1666 | } |
1672 | |
1667 | |
1673 | /* Since we just removed op, op->above is null */ |
1668 | /* Since we just removed op, op->above is null */ |
1674 | for (tmp = above; tmp != NULL; tmp = tmp->above) |
1669 | for (tmp = above; tmp; tmp = tmp->above) |
1675 | if (tmp->type == PLAYER) |
1670 | if (tmp->type == PLAYER) |
1676 | { |
1671 | { |
1677 | if (op->nrof) |
1672 | if (op->nrof) |
1678 | esrv_send_item (tmp, op); |
1673 | esrv_send_item (tmp, op); |
1679 | else |
1674 | else |
… | |
… | |
1684 | if (op->nrof) |
1679 | if (op->nrof) |
1685 | return op; |
1680 | return op; |
1686 | else |
1681 | else |
1687 | { |
1682 | { |
1688 | op->destroy (); |
1683 | op->destroy (); |
1689 | return NULL; |
1684 | return 0; |
1690 | } |
1685 | } |
1691 | } |
1686 | } |
1692 | |
1687 | |
1693 | /* |
1688 | /* |
1694 | * add_weight(object, weight) adds the specified weight to an object, |
1689 | * add_weight(object, weight) adds the specified weight to an object, |