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.47 by root, Tue Jun 5 13:05:03 2007 UTC vs.
Revision 1.49 by root, Fri Jun 8 09:20:20 2007 UTC

845 845
846 maptile *m = pl->observe->map; 846 maptile *m = pl->observe->map;
847 sint16 x = pl->observe->x + dx; 847 sint16 x = pl->observe->x + dx;
848 sint16 y = pl->observe->y + dy; 848 sint16 y = pl->observe->y + dy;
849 849
850 if (!m)
851 return;
852
850 if (!xy_normalise (m, x, y)) 853 if (!xy_normalise (m, x, y))
851 { 854 {
852 new_draw_info (NDI_UNIQUE, 0, ob, "You see nothing there."); 855 new_draw_info (NDI_UNIQUE, 0, ob, "You see nothing there.");
853 return; 856 return;
854 } 857 }
894 897
895/** Client wants to look at some object. Lets do so. */ 898/** Client wants to look at some object. Lets do so. */
896void 899void
897LookAt (char *buf, int len, player *pl) 900LookAt (char *buf, int len, player *pl)
898{ 901{
899 int dx, dy;
900 char *cp; 902 char *cp;
901 903
902 dx = atoi (buf); 904 int dx = atoi (buf);
903 if (!(cp = strchr (buf, ' '))) 905 if (!(cp = strchr (buf, ' ')))
904 return; 906 return;
905 907
906 dy = atoi (cp); 908 int dy = atoi (cp);
909
910 if (player *opl = pl->observe->contr)
911 if (client *ns = opl->ns)
912 {
907 if (fabs (dx) > pl->ns->mapx / 2 || fabs (dy) > pl->ns->mapy / 2) 913 if (fabs (dx) > ns->mapx / 2 || fabs (dy) > ns->mapy / 2)
908 return; 914 return;
909 915
910 if (pl->blocked_los[dx + pl->ns->mapx / 2][dy + pl->ns->mapy / 2]) 916 if (opl->blocked_los[dx + ns->mapx / 2][dy + ns->mapy / 2])
911 return; 917 return;
918 }
912 919
913 look_at (pl, dx, dy); 920 look_at (pl, dx, dy);
914} 921}
915 922
916/** Move an object to a new location */ 923/** Move an object to a new location */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines