--- deliantra/server/socket/item.C 2006/09/10 13:43:33 1.5 +++ deliantra/server/socket/item.C 2006/09/27 00:36:09 1.10 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_item_c = - * "$Id: item.C,v 1.5 2006/09/10 13:43:33 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The author can be reached via e-mail to crossfire-devel@real-time.com + The author can be reached via e-mail to */ /** @@ -613,7 +607,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) @@ -621,6 +620,7 @@ LOG (llevDebug, "Player '%s' tried to examine the unknown object (%ld)\n", &pl->ob->name, tag); return; } + examine (pl->ob, op); } @@ -628,8 +628,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. @@ -645,11 +644,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); } @@ -685,13 +687,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)); } @@ -708,7 +711,7 @@ object *tmp; int flag = 0; sint16 x, y; - mapstruct *m; + maptile *m; x = op->x + dx; y = op->y + dy;