--- deliantra/server/socket/request.C 2007/04/30 17:39:59 1.92 +++ deliantra/server/socket/request.C 2007/05/17 14:14:56 1.97 @@ -1,5 +1,5 @@ /* - * CrossFire, A Multiplayer game for X-windows + * CrossFire, A Multiplayer game * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2001 Mark Wedel @@ -732,31 +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->ob->current_weapon == pl->ranged_ob ? "*" : "") << ": " << pl->ranged_ob->name; - 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->combat_ob) + 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); + buf.linearise (obuf); + obuf [buf.size ()] = 0; } #define AddIfInt64(Old,New,Type) if (Old != New) {\ @@ -873,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);