--- deliantra/server/socket/request.C 2007/04/18 09:38:58 1.86 +++ 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); } @@ -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,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); \ @@ -1239,7 +1255,7 @@ *last_ext |= 0x80; last_ext = &sl[sl.length ()]; - sl << uint8 (0x43) << uint8 (4) << (uint32)player; + sl << uint8 (0x47) << uint8 (4) << (uint32)player; } if (lastcell.flags != flags)