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.68 by root, Mon Dec 18 02:35:00 2006 UTC vs.
Revision 1.73 by root, Wed Dec 20 01:19:11 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines