--- deliantra/server/socket/request.C 2007/04/14 14:47:48 1.85 +++ deliantra/server/socket/request.C 2007/04/30 17:39:59 1.92 @@ -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,37 @@ 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 << " Range: " + << (pl->ranged_ob + ? pl->ranged_ob->name + : pl->ranged_skill->name); + + if (pl->combat_skill) + buf << " Combat: " + << (pl->combat_ob + ? pl->combat_ob->name + : pl->combat_skill->name); + + if (pl->golem) + buf << " Golem: " << pl->golem->name; + + if (buf.empty ()) + *obuf = 0; + else + memcpy (obuf, buf.linearise () + 1, buf.size () - 1); +} + #define AddIfInt64(Old,New,Type) if (Old != New) {\ Old = New; \ sl << uint8 (Type) << uint64 (New); \ @@ -1185,10 +1204,10 @@ if (socket.extmap) { - uint8 stat_hp = 0; + uint8 stat_hp = 0; uint8 stat_width = 0; - uint8 flags = 0; - UUID player = 0; + uint8 flags = 0; + tag_t player = 0; // send hp information, if applicable if (object *op = ms.faces_obj [0]) @@ -1239,7 +1258,7 @@ *last_ext |= 0x80; last_ext = &sl[sl.length ()]; - sl << uint8 (0x47) << uint8 (8) << (uint64)player; + sl << uint8 (0x47) << uint8 (4) << (uint32)player; } if (lastcell.flags != flags)