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

Comparing deliantra/server/socket/item.C (file contents):
Revision 1.9 by root, Wed Sep 20 21:53:50 2006 UTC vs.
Revision 1.10 by root, Wed Sep 27 00:36:09 2006 UTC

605 605
606/** Client wants to examine some object. So lets do so. */ 606/** Client wants to examine some object. So lets do so. */
607void 607void
608ExamineCmd (char *buf, int len, player *pl) 608ExamineCmd (char *buf, int len, player *pl)
609{ 609{
610 long tag = atoi (buf); 610 tag_t tag = atoi (buf);
611
612 /* If the high bit is set, player examined a pseudo object. */
613 if (tag & 0x80000000)
614 return;
615
611 object *op = esrv_get_ob_from_count (pl->ob, tag); 616 object *op = esrv_get_ob_from_count (pl->ob, tag);
612 617
613 if (!op) 618 if (!op)
614 { 619 {
615 LOG (llevDebug, "Player '%s' tried to examine the unknown object (%ld)\n", &pl->ob->name, tag); 620 LOG (llevDebug, "Player '%s' tried to examine the unknown object (%ld)\n", &pl->ob->name, tag);
616 return; 621 return;
617 } 622 }
623
618 examine (pl->ob, op); 624 examine (pl->ob, op);
619} 625}
620 626
621/** Client wants to apply some object. Lets do so. */ 627/** Client wants to apply some object. Lets do so. */
622void 628void
623ApplyCmd (char *buf, int len, player *pl) 629ApplyCmd (char *buf, int len, player *pl)
624{ 630{
625 uint32 tag = atoi (buf); 631 tag_t tag = atoi (buf);
626 object *op = esrv_get_ob_from_count (pl->ob, tag);
627 632
628 /* sort of a hack, but if the player saves and the player then manually 633 /* sort of a hack, but if the player saves and the player then manually
629 * applies a savebed (or otherwise tries to do stuff), we run into trouble. 634 * applies a savebed (or otherwise tries to do stuff), we run into trouble.
630 */ 635 */
631 if (QUERY_FLAG (pl->ob, FLAG_REMOVED)) 636 if (QUERY_FLAG (pl->ob, FLAG_REMOVED))
637 pl->socket.look_position = tag & 0x7fffffff; 642 pl->socket.look_position = tag & 0x7fffffff;
638 pl->socket.update_look = 1; 643 pl->socket.update_look = 1;
639 return; 644 return;
640 } 645 }
641 646
647 object *op = esrv_get_ob_from_count (pl->ob, tag);
648
642 if (!op) 649 if (!op)
643 { 650 {
644 LOG (llevDebug, "Player '%s' tried to apply the unknown object (%d)\n", &pl->ob->name, tag); 651 LOG (llevDebug, "Player '%s' tried to apply the unknown object (%d)\n", &pl->ob->name, tag);
645 return; 652 return;
646 } 653 }
654
647 player_apply (pl->ob, op, 0, 0); 655 player_apply (pl->ob, op, 0, 0);
648} 656}
649 657
650/** Client wants to apply some object. Lets do so. */ 658/** Client wants to apply some object. Lets do so. */
651void 659void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines