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.115 by root, Sun Apr 4 02:51:57 2010 UTC vs.
Revision 1.119 by root, Sat Apr 10 04:54:09 2010 UTC

189 189
190 while (*params == ' ') 190 while (*params == ' ')
191 params++; 191 params++;
192 192
193 if (object *inv = find_best_apply_object_match (op, params, aflag)) 193 if (object *inv = find_best_apply_object_match (op, params, aflag))
194 player_apply (op, inv, aflag); 194 op->apply (inv, aflag);
195 else 195 else
196 new_draw_info_format (NDI_UNIQUE, 0, op, "Could not find any match to the %s.", params); 196 op->failmsgf ("Could not find any match to the %s.", params);
197 } 197 }
198 198
199 return 0; 199 return 0;
200} 200}
201 201
556 */ 556 */
557 if ((sack->type == CONTAINER) && !sack_can_hold (op, sack, tmp, (nrof ? nrof : tmp->nrof))) 557 if ((sack->type == CONTAINER) && !sack_can_hold (op, sack, tmp, (nrof ? nrof : tmp->nrof)))
558 return; 558 return;
559 559
560 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 560 if (QUERY_FLAG (tmp, FLAG_APPLIED))
561 if (apply_special (op, tmp, AP_UNAPPLY | AP_NO_MERGE)) 561 if (!op->apply (tmp, AP_UNAPPLY | AP_NO_MERGE))
562 return; 562 return;
563 563
564 /* we want to put some portion of the item into the container */ 564 /* we want to put some portion of the item into the container */
565 if (!can_split (op, tmp, nrof)) 565 if (!can_split (op, tmp, nrof))
566 return; 566 return;
635{ 635{
636 if (QUERY_FLAG (tmp, FLAG_NO_DROP)) 636 if (QUERY_FLAG (tmp, FLAG_NO_DROP))
637 return; 637 return;
638 638
639 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 639 if (QUERY_FLAG (tmp, FLAG_APPLIED))
640 if (apply_special (op, tmp, AP_UNAPPLY | AP_NO_MERGE)) 640 if (!op->apply (tmp, AP_UNAPPLY | AP_NO_MERGE))
641 return; /* can't unapply it */ 641 return; /* can't unapply it */
642 642
643 /* We are only dropping some of the items. We split the current object 643 /* We are only dropping some of the items. We split the current object
644 * off 644 * off
645 */ 645 */
1303 esrv_update_item (UPD_FLAGS, op, item); 1303 esrv_update_item (UPD_FLAGS, op, item);
1304 } 1304 }
1305 1305
1306 return 0; 1306 return 0;
1307} 1307}
1308
1309/* op should be a player, params is any params.
1310 * If no params given, we print out the currently marked object.
1311 * otherwise, try to find a matching object - try best match first.
1312 */
1313int
1314command_mark (object *op, char *params)
1315{
1316 if (!params)
1317 {
1318 if (object *mark = find_marked_object (op))
1319 op->statusmsg (format ("%s is marked.", query_name (mark)));
1320 else
1321 op->failmsg ("You have no marked object.");
1322 }
1323 else
1324 {
1325 if (object *mark = find_best_object_match (op, params))
1326 {
1327 op->contr->mark = mark;
1328 op->statusmsg (format ("Marked item %s", query_name (mark)));
1329 }
1330 else
1331 op->failmsgf ("Could not find an object that matches %s", params);
1332 }
1333
1334 return 0; /*shouldnt get here */
1335}
1336

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines