--- deliantra/server/socket/request.C 2007/05/01 05:48:21 1.93 +++ deliantra/server/socket/request.C 2007/05/12 19:30:18 1.96 @@ -732,28 +732,22 @@ * Get player's current range attack in obuf. */ static void -rangetostring (object *ob, char *obuf) +rangetostring (player *pl, char *obuf) { dynbuf_text buf; - player *pl = ob->contr; - if (pl->ranged_ob) - buf << " Range: " << pl->ranged_ob->name; + buf << " Range" << (pl->ob->current_weapon == pl->ranged_ob ? "*" : "") << ": " << pl->ranged_ob->name; if (pl->combat_ob) - buf << " Combat: " << pl->combat_ob->name; + buf << " Combat" << (pl->ob->current_weapon == pl->combat_ob ? "*" : "") << ": " << pl->combat_ob->name; + //TODO: maybe golem should become the current_weapon, quite simply? if (pl->golem) - buf << " Golem: " << pl->golem->name; + buf << " Golem*: " << pl->golem->name; - if (buf.empty ()) - *obuf = 0; - else - { - memcpy (obuf, buf.linearise () + 1, buf.size () - 1); - obuf [buf.size ()] = 0; - } + buf.linearise (obuf); + obuf [buf.size ()] = 0; } #define AddIfInt64(Old,New,Type) if (Old != New) {\ @@ -870,7 +864,7 @@ AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY); } - rangetostring (ob, buf); /* we want use the new fire & run system in new client */ + rangetostring (pl, buf); /* we want use the new fire & run system in new client */ AddIfString (ns->stats.range, buf, CS_STAT_RANGE); set_title (ob, buf); AddIfString (ns->stats.title, buf, CS_STAT_TITLE);