--- deliantra/server/socket/item.C 2008/10/28 12:48:23 1.72 +++ deliantra/server/socket/item.C 2008/12/28 06:59:27 1.76 @@ -686,35 +686,64 @@ if (!pl->observe->map) return; + bool wiz = ob->flag [FLAG_WIZ] || ob->flag [FLAG_WIZLOOK]; + mapxy pos (pl->observe); pos.move (dx, dy); - if (pos.normalise ()) - for (object *tmp = pos->top; tmp; tmp = tmp->below) - { - if (tmp->invisible && !QUERY_FLAG (ob, FLAG_WIZ)) - continue; - - if (QUERY_FLAG (ob, FLAG_WIZ)) - buf.printf (" - %s (%d).\n", query_name (tmp), tmp->count); - else - buf.printf (" - %s.\n", query_name (tmp)); - - object *head = tmp->head_ (); - - if (head->inv) - if ((head->type != CONTAINER && head->type != FLESH) - || QUERY_FLAG (ob, FLAG_WIZ)) - buf << head->query_inventory (ob, " "); - - if (QUERY_FLAG (tmp, FLAG_IS_FLOOR) && !QUERY_FLAG (ob, FLAG_WIZ)) /* don't continue under the floor */ - break; - } + if (wiz) + { + if (pos.normalise ()) + { + mapspace &ms = *pos; + ms.update (); + + buf.printf (" map: %s%+d%+d (%+d%+d)\n" + " smell %u/%u; flags %x; light %d; block %x; slow %x; on %x; off %x; volume %lld\n\n", + &pos.m->path, pos.x, pos.y, dx, dy, + (unsigned int)ms.smell, (unsigned int)mapspace::smellcount, ms.flags (), ms.light, + ms.move_block, ms.move_slow, ms.move_on, ms.move_off, (long long)ms.volume () + ); + } + else + buf << "off-map\n\n"; + } + + int darkness = pl->blocked_los (dx, dy); + + if (darkness == LOS_BLOCKED) + buf << "You cannot see that place from your position. H"; + else if (darkness == LOS_MAX) + buf << "That place is too dark to see anything. H"; + else + { + if (pos.normalise ()) + for (object *tmp = pos->top; tmp; tmp = tmp->below) + { + if (tmp->invisible && !QUERY_FLAG (ob, FLAG_WIZ)) + continue; + + if (wiz) + buf.printf (" - %s (%d).\n", query_name (tmp), tmp->count); + else + buf.printf (" - %s.\n", query_name (tmp)); + + object *head = tmp->head_ (); + + if (head->inv) + if ((head->type != CONTAINER && head->type != FLESH) + || QUERY_FLAG (ob, FLAG_WIZ)) + buf << head->query_inventory (ob, " "); + + if (QUERY_FLAG (tmp, FLAG_IS_FLOOR) && !wiz) /* don't continue under the floor */ + break; + } + } if (buf.empty ()) - pl->failmsg ("You see nothing there."); - else - pl->infobox (MSG_CHANNEL ("lookat"), buf); + buf << "You see nothing there."; + + pl->infobox (MSG_CHANNEL ("lookat"), buf); } /** Client wants to look at some object. Lets do so. */ @@ -729,16 +758,6 @@ int dy = atoi (cp); - if (player *opl = pl->observe->contr) - if (client *ns = opl->ns) - { - if (fabs (dx) > ns->mapx / 2 || fabs (dy) > ns->mapy / 2) - return; - - if (opl->blocked_los[dx + ns->mapx / 2][dy + ns->mapy / 2]) - return; - } - look_at (pl, dx, dy); }