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.33 by root, Fri Jan 12 01:29:13 2007 UTC vs.
Revision 1.35 by root, Sun Jan 21 21:28:27 2007 UTC

304 { 304 {
305 if (head->anim_speed) 305 if (head->anim_speed)
306 anim_speed = head->anim_speed; 306 anim_speed = head->anim_speed;
307 else 307 else
308 { 308 {
309 if (FABS (head->speed) < 0.001) 309 if (fabs (head->speed) < 0.001)
310 anim_speed = 255; 310 anim_speed = 255;
311 else if (FABS (head->speed) >= 1.0) 311 else if (fabs (head->speed) >= 1.0)
312 anim_speed = 1; 312 anim_speed = 1;
313 else 313 else
314 anim_speed = (int) (1.0 / FABS (head->speed)); 314 anim_speed = (int) (1.0 / fabs (head->speed));
315 } 315 }
316 316
317 if (anim_speed > 255) 317 if (anim_speed > 255)
318 anim_speed = 255; 318 anim_speed = 255;
319 } 319 }
604 { 604 {
605 if (op->anim_speed) 605 if (op->anim_speed)
606 anim_speed = op->anim_speed; 606 anim_speed = op->anim_speed;
607 else 607 else
608 { 608 {
609 if (FABS (op->speed) < 0.001) 609 if (fabs (op->speed) < 0.001)
610 anim_speed = 255; 610 anim_speed = 255;
611 else if (FABS (op->speed) >= 1.0) 611 else if (fabs (op->speed) >= 1.0)
612 anim_speed = 1; 612 anim_speed = 1;
613 else 613 else
614 anim_speed = (int) (1.0 / FABS (op->speed)); 614 anim_speed = (int) (1.0 / fabs (op->speed));
615 } 615 }
616 616
617 if (anim_speed > 255) 617 if (anim_speed > 255)
618 anim_speed = 255; 618 anim_speed = 255;
619 } 619 }
631 * Sends item's info to player. 631 * Sends item's info to player.
632 */ 632 */
633void 633void
634esrv_send_item (object *pl, object *op) 634esrv_send_item (object *pl, object *op)
635{ 635{
636 if (!pl->contr->ns)
637 return;
638
636 /* If this is not the player object, do some more checks */ 639 /* If this is not the player object, do some more checks */
637 if (op != pl) 640 if (op != pl)
638 { 641 {
639 /* We only send 'visibile' objects to the client */ 642 /* We only send 'visibile' objects to the client */
640 if (!op->client_visible ()) 643 if (!op->client_visible ())
892 { 895 {
893 return; 896 return;
894 } 897 }
895 dy = atoi (cp); 898 dy = atoi (cp);
896 899
897 if (FABS (dx) > pl->ns->mapx / 2 || FABS (dy) > pl->ns->mapy / 2) 900 if (fabs (dx) > pl->ns->mapx / 2 || fabs (dy) > pl->ns->mapy / 2)
898 return; 901 return;
899 902
900 if (pl->blocked_los[dx + pl->ns->mapx / 2][dy + pl->ns->mapy / 2]) 903 if (pl->blocked_los[dx + pl->ns->mapx / 2][dy + pl->ns->mapy / 2])
901 return; 904 return;
902 905

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines