--- deliantra/server/socket/item.C 2006/09/12 19:20:09 1.6 +++ deliantra/server/socket/item.C 2006/09/27 00:36:09 1.10 @@ -18,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 */ /** @@ -607,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) @@ -615,6 +620,7 @@ LOG (llevDebug, "Player '%s' tried to examine the unknown object (%ld)\n", &pl->ob->name, tag); return; } + examine (pl->ob, op); } @@ -622,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. @@ -639,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); } @@ -679,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)); } @@ -702,7 +711,7 @@ object *tmp; int flag = 0; sint16 x, y; - mapstruct *m; + maptile *m; x = op->x + dx; y = op->y + dy;