--- deliantra/server/socket/item.C 2006/09/16 22:24:13 1.8 +++ deliantra/server/socket/item.C 2006/12/13 21:27:09 1.11 @@ -397,6 +397,7 @@ * order. */ } + if (!QUERY_FLAG (op, FLAG_CLIENT_SENT)) { /* FLAG_CLIENT_SENT is debug only. We are using it to see where @@ -405,6 +406,7 @@ */ LOG (llevDebug, "We have not sent item %s (%d)\n", &op->name, op->count); } + sl.buf = (unsigned char *) malloc (MAXSOCKBUF); strcpy ((char *) sl.buf, "upditem "); @@ -440,6 +442,7 @@ esrv_send_face (&pl->contr->socket, op->face->number, 0); SockList_AddInt (&sl, op->face->number); } + if (flags & UPD_NAME) { int len; @@ -468,6 +471,7 @@ memcpy (sl.buf + sl.len, item_n, len); sl.len += len; } + if (flags & UPD_ANIM) SockList_AddShort (&sl, op->animation_id); @@ -607,7 +611,12 @@ void ExamineCmd (char *buf, int len, player *pl) { - long tag = atoi (buf); + tag_t tag = atoi (buf); + + /* If the high bit is set, player examined a pseudo object. */ + if (tag & 0x80000000) + return; + object *op = esrv_get_ob_from_count (pl->ob, tag); if (!op) @@ -615,6 +624,7 @@ LOG (llevDebug, "Player '%s' tried to examine the unknown object (%ld)\n", &pl->ob->name, tag); return; } + examine (pl->ob, op); } @@ -622,8 +632,7 @@ void ApplyCmd (char *buf, int len, player *pl) { - uint32 tag = atoi (buf); - object *op = esrv_get_ob_from_count (pl->ob, tag); + tag_t tag = atoi (buf); /* sort of a hack, but if the player saves and the player then manually * applies a savebed (or otherwise tries to do stuff), we run into trouble. @@ -639,11 +648,14 @@ return; } + object *op = esrv_get_ob_from_count (pl->ob, tag); + if (!op) { LOG (llevDebug, "Player '%s' tried to apply the unknown object (%d)\n", &pl->ob->name, tag); return; } + player_apply (pl->ob, op, 0, 0); } @@ -679,13 +691,14 @@ tag = GetInt_String (data); op = esrv_get_ob_from_count (pl->ob, tag); + if (!op) { new_draw_info (NDI_UNIQUE, 0, pl->ob, "Could not find object to mark"); return; } + pl->mark = op; - pl->mark_count = op->count; new_draw_info_format (NDI_UNIQUE, 0, pl->ob, "Marked item %s", query_name (op)); }