--- deliantra/server/socket/request.C 2007/04/24 00:42:03 1.88 +++ deliantra/server/socket/request.C 2007/05/01 05:48:21 1.93 @@ -161,14 +161,10 @@ { int flags = 0; - if (ob->map->tile_path[0]) - flags |= 1; - if (ob->map->tile_path[1]) - flags |= 2; - if (ob->map->tile_path[2]) - flags |= 4; - if (ob->map->tile_path[3]) - flags |= 8; + if (ob->map->tile_path[0]) flags |= 1; + if (ob->map->tile_path[1]) flags |= 2; + if (ob->map->tile_path[2]) flags |= 4; + if (ob->map->tile_path[3]) flags |= 8; snprintf (buf, MAX_BUF, "mapinfo - spatial %d %d %d %d %d %s", flags, socket.mapx / 2 - ob->x, socket.mapy / 2 - ob->y, ob->map->width, ob->map->height, &ob->map->path); @@ -327,14 +323,10 @@ { int flags = 0; - if (map->tile_path[0]) - flags |= 1; - if (map->tile_path[1]) - flags |= 2; - if (map->tile_path[2]) - flags |= 4; - if (map->tile_path[3]) - flags |= 8; + if (map->tile_path[0]) flags |= 1; + if (map->tile_path[1]) flags |= 2; + if (map->tile_path[2]) flags |= 4; + if (map->tile_path[3]) flags |= 8; snprintf (bigbuf, MAX_BUF, "mapinfo %s spatial %d %d %d %d %d %s", token, flags, mapx, mapy, map->width, map->height, &map->path); } @@ -661,7 +653,7 @@ if (cp) { - assign (ns->version, cp + 1); + ns->version = cp + 1; if (ns->sc_version < 1026) ns->send_packet_printf ("drawinfo %d %s", NDI_RED, @@ -736,6 +728,34 @@ ns->send_packet_printf ("query %d %s", flags, text ? text : ""); } +/** + * Get player's current range attack in obuf. + */ +static void +rangetostring (object *ob, char *obuf) +{ + dynbuf_text buf; + + player *pl = ob->contr; + + if (pl->ranged_ob) + buf << " Range: " << pl->ranged_ob->name; + + if (pl->combat_ob) + buf << " Combat: " << pl->combat_ob->name; + + if (pl->golem) + buf << " Golem: " << pl->golem->name; + + if (buf.empty ()) + *obuf = 0; + else + { + memcpy (obuf, buf.linearise () + 1, buf.size () - 1); + obuf [buf.size ()] = 0; + } +} + #define AddIfInt64(Old,New,Type) if (Old != New) {\ Old = New; \ sl << uint8 (Type) << uint64 (New); \