--- deliantra/server/socket/item.C 2007/01/12 01:29:13 1.33 +++ deliantra/server/socket/item.C 2007/02/26 20:36:15 1.39 @@ -306,12 +306,12 @@ anim_speed = head->anim_speed; else { - if (FABS (head->speed) < 0.001) + if (fabs (head->speed) < 0.001) anim_speed = 255; - else if (FABS (head->speed) >= 1.0) + else if (fabs (head->speed) >= 1.0) anim_speed = 1; else - anim_speed = (int) (1.0 / FABS (head->speed)); + anim_speed = (int) (1.0 / fabs (head->speed)); } if (anim_speed > 255) @@ -340,7 +340,7 @@ if (!pl->contr->ns->update_look) { - LOG (llevDebug, "esrv_draw_look called when update_look was not set\n"); + LOG (llevDebug, "esrv_draw_look called when update_look was not set (player %s)\n", &pl->name); return; } else @@ -504,7 +504,6 @@ * to the client (as defined in newclient.h - might as well use the * same value both places. */ - void esrv_update_item (int flags, object *pl, object *op) { @@ -606,12 +605,12 @@ anim_speed = op->anim_speed; else { - if (FABS (op->speed) < 0.001) + if (fabs (op->speed) < 0.001) anim_speed = 255; - else if (FABS (op->speed) >= 1.0) + else if (fabs (op->speed) >= 1.0) anim_speed = 1; else - anim_speed = (int) (1.0 / FABS (op->speed)); + anim_speed = (int) (1.0 / fabs (op->speed)); } if (anim_speed > 255) @@ -633,6 +632,9 @@ void esrv_send_item (object *pl, object *op) { + if (!pl->contr->ns) + return; + /* If this is not the player object, do some more checks */ if (op != pl) { @@ -669,10 +671,12 @@ * Tells the client to delete an item. Uses the item * command with a -1 location. */ - void esrv_del_item (player *pl, int tag) { + if (!pl->ns) + return; + packet sl ("delitem"); sl << uint32 (tag); @@ -878,8 +882,6 @@ } } - - /** Client wants to look at some object. Lets do so. */ void LookAt (char *buf, int len, player *pl) @@ -894,7 +896,7 @@ } dy = atoi (cp); - if (FABS (dx) > pl->ns->mapx / 2 || FABS (dy) > pl->ns->mapy / 2) + if (fabs (dx) > pl->ns->mapx / 2 || fabs (dy) > pl->ns->mapy / 2) return; if (pl->blocked_los[dx + pl->ns->mapx / 2][dy + pl->ns->mapy / 2])