… | |
… | |
894 | |
894 | |
895 | /** Client wants to look at some object. Lets do so. */ |
895 | /** Client wants to look at some object. Lets do so. */ |
896 | void |
896 | void |
897 | LookAt (char *buf, int len, player *pl) |
897 | LookAt (char *buf, int len, player *pl) |
898 | { |
898 | { |
899 | int dx, dy; |
|
|
900 | char *cp; |
899 | char *cp; |
901 | |
900 | |
902 | dx = atoi (buf); |
901 | int dx = atoi (buf); |
903 | if (!(cp = strchr (buf, ' '))) |
902 | if (!(cp = strchr (buf, ' '))) |
904 | return; |
903 | return; |
905 | |
904 | |
906 | dy = atoi (cp); |
905 | int dy = atoi (cp); |
|
|
906 | |
|
|
907 | if (player *opl = pl->observe->contr) |
|
|
908 | if (client *ns = opl->ns) |
|
|
909 | { |
907 | if (fabs (dx) > pl->ns->mapx / 2 || fabs (dy) > pl->ns->mapy / 2) |
910 | if (fabs (dx) > ns->mapx / 2 || fabs (dy) > ns->mapy / 2) |
908 | return; |
911 | return; |
909 | |
912 | |
910 | if (pl->blocked_los[dx + pl->ns->mapx / 2][dy + pl->ns->mapy / 2]) |
913 | if (opl->blocked_los[dx + ns->mapx / 2][dy + ns->mapy / 2]) |
911 | return; |
914 | return; |
|
|
915 | } |
912 | |
916 | |
913 | look_at (pl, dx, dy); |
917 | look_at (pl, dx, dy); |
914 | } |
918 | } |
915 | |
919 | |
916 | /** Move an object to a new location */ |
920 | /** Move an object to a new location */ |