ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_object.C
(Generate patch)

Comparing deliantra/server/server/c_object.C (file contents):
Revision 1.106 by root, Wed Nov 11 04:45:22 2009 UTC vs.
Revision 1.107 by elmex, Fri Nov 13 15:41:39 2009 UTC

1412 op->contr->queue_stats_update (); 1412 op->contr->queue_stats_update ();
1413 1413
1414 return 1; 1414 return 1;
1415} 1415}
1416 1416
1417int
1418command_unlock (object *op, char *params)
1419{
1420 /* if the unlock command typed with nothing, unlock everything,
1421 * this might be bad
1422 */
1423 if (params == NULL)
1424 {
1425 for (object *item = op->inv; item; item = item->below)
1426 {
1427 CLEAR_FLAG(item, FLAG_INV_LOCKED);
1428 //d// new_draw_info (NDI_UNIQUE, 0, op, "unlocked items with null param.");
1429 esrv_update_item (UPD_FLAGS, op, item);
1430 }
1431 return 0;
1432 }
1433
1434 /* if the unlock command is used with a param,
1435 * unlock what matches. i.e. unlock material, should unlock all the materials
1436 */
1437 for (object *item = op->inv; item; item = item->below)
1438 if (item->name.contains (params))
1439 {
1440 CLEAR_FLAG (item, FLAG_INV_LOCKED);
1441 //d// new_draw_info (NDI_UNIQUE, 0, op, "unlocked items with a param.");
1442 esrv_update_item (UPD_FLAGS, op, item);
1443 }
1444
1445 return 0;
1446}
1447
1448int
1449command_lock (object *op, char *params)
1450{
1451 /* if the lock command is typed by itself, lock everything
1452 */
1453 if (params == NULL)
1454 {
1455 for (object *item = op->inv; item; item = item->below)
1456 {
1457 SET_FLAG (item, FLAG_INV_LOCKED);
1458 //d// new_draw_info (NDI_UNIQUE, 0, op, "locked items with null param.");
1459 esrv_update_item (UPD_FLAGS, op, item);
1460 }
1461 return 0;
1462 }
1463
1464 /* if the lock command is used with a param, lock what matches.
1465 * i.e. lock material, should lock all the materials
1466 */
1467 for (object *item = op->inv; item; item = item->below)
1468 if (item->name.contains (params))
1469 {
1470 SET_FLAG (item, FLAG_INV_LOCKED);
1471 //d// new_draw_info (NDI_UNIQUE, 0, op, "locked items with param.");
1472 esrv_update_item (UPD_FLAGS, op, item);
1473 }
1474
1475 return 0;
1476}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines