--- deliantra/server/socket/request.C 2007/04/19 11:12:46 1.87 +++ deliantra/server/socket/request.C 2007/04/30 04:25:30 1.91 @@ -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); } @@ -613,10 +605,6 @@ LOG (llevError, "Got reply message with ST_PLAYING input state\n"); break; - case ST_CHANGE_CLASS: - key_change_class (pl->ob, buf[0]); - break; - case ST_GET_PARTY_PASSWORD: /* Get password for party */ receive_party_password (pl->ob, 13); break; @@ -665,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, @@ -740,6 +728,38 @@ 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_skill) + { + buf.printf (" Range: %s", &pl->ranged_skill->name); + + if (pl->ranged_ob) + buf.printf (" (%s)", query_base_name (pl->ranged_ob, 0)); + } + + if (pl->combat_skill) + { + buf.printf (" Combat: %s", &pl->combat_skill->name); + + if (pl->combat_ob) + buf.printf (" (%s)", query_base_name (pl->combat_ob, 0)); + } + + if (pl->golem) + buf.printf (" Golem: %s", &pl->golem->name); + + strcpy (obuf, buf.linearise () + 1); +} + #define AddIfInt64(Old,New,Type) if (Old != New) {\ Old = New; \ sl << uint8 (Type) << uint64 (New); \