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.120 by root, Sun Apr 11 00:34:06 2010 UTC vs.
Revision 1.121 by root, Wed Apr 14 21:36:32 2010 UTC

950 } 950 }
951 951
952 return 0; 952 return 0;
953} 953}
954 954
955/* op should be a player.
956 * we return the object the player has marked with the 'mark' command
957 * below. If no match is found (or object has changed), we return
958 * NULL. We leave it up to the calling function to print messages if
959 * nothing is found.
960 */
961object *
962find_marked_object (object *op)
963{
964 object *tmp;
965
966 if (!op || !op->contr)
967 return NULL;
968
969 if (!op->contr->mark)
970 {
971/* new_draw_info(NDI_UNIQUE,0,op,"You have no marked object");*/
972 return 0;
973 }
974
975 /* This may seem like overkill, but we need to make sure that they
976 * player hasn't dropped the item. We use count on the off chance that
977 * an item got reincarnated at some point.
978 */
979 for (tmp = op->inv; tmp; tmp = tmp->below)
980 {
981 if (tmp->invisible)
982 continue;
983
984 if (tmp == op->contr->mark)
985 {
986 if (!tmp->destroyed ())
987 return tmp;
988 else
989 {
990 op->contr->mark = 0;
991/* new_draw_info(NDI_UNIQUE,0,op,"You have no marked object");*/
992 return 0;
993 }
994 }
995 }
996
997 return 0;
998}
999
1000std::string 955std::string
1001object::describe_monster (object *who) 956object::describe_monster (object *who)
1002{ 957{
1003 dynbuf_text buf (512, 512); 958 dynbuf_text buf (512, 512);
1004 959
1313int 1268int
1314command_mark (object *op, char *params) 1269command_mark (object *op, char *params)
1315{ 1270{
1316 if (!params) 1271 if (!params)
1317 { 1272 {
1318 if (object *mark = find_marked_object (op)) 1273 if (object *mark = op->mark ())
1319 op->statusmsg (format ("%s is marked.", query_name (mark))); 1274 op->statusmsg (format ("%s is marked.", query_name (mark)));
1320 else 1275 else
1321 op->failmsg ("You have no marked object."); 1276 op->failmsg ("You have no marked object.");
1322 } 1277 }
1323 else 1278 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines