--- deliantra/server/socket/request.C 2008/06/15 19:34:31 1.132 +++ deliantra/server/socket/request.C 2008/09/25 22:58:13 1.139 @@ -835,7 +835,7 @@ AddIfShort (ns->last_stats.Cha, ob->stats.Cha, CS_STAT_CHA); for (int s = 0; s < NUM_SKILLS; s++) - if (object *skill = opl->last_skill_ob[s]) + if (object *skill = opl->last_skill_ob [s]) if (skill->stats.exp != ns->last_skill_exp [s]) { ns->last_skill_exp [s] = skill->stats.exp; @@ -914,7 +914,6 @@ pl->ns->last_weight = weight; pl->ns->send_packet (sl); - SET_FLAG (pl->ob, FLAG_CLIENT_SENT); } /****************************************************************************** @@ -1179,7 +1178,6 @@ if (d > 3) { - int need_send = 0, count; /* This block deals with spaces that are not visible for whatever @@ -1195,11 +1193,11 @@ count = -1; - /* properly clear a previously sent big face */ if (lastcell.faces[0] || lastcell.faces[1] || lastcell.faces[2] || lastcell.stat_hp || lastcell.flags || lastcell.player) need_send = 1; + /* properly clear a previously sent big face */ map_clearcell (&lastcell, count); if ((mask & 0xf) || need_send) @@ -1265,17 +1263,21 @@ && op->stats.maxhp > 0 && (op->type == PLAYER || op->type == DOOR // does not work, have maxhp 0 - || QUERY_FLAG (op, FLAG_MONSTER) || QUERY_FLAG (op, FLAG_ALIVE) || QUERY_FLAG (op, FLAG_GENERATOR))) + || QUERY_FLAG (op, FLAG_MONSTER) + || QUERY_FLAG (op, FLAG_ALIVE) + || QUERY_FLAG (op, FLAG_GENERATOR))) { stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge } - if (op->msg && op->msg[0] == '@') + if (op->has_dialogue ()) flags |= 1; - if (op->type == PLAYER && op != ob) - player = op->count; + if (op->type == PLAYER) + player = op == ob ? pl->ob->count + : op == pl->ob ? ob->count + : op->count; } if (lastcell.stat_hp != stat_hp) @@ -1435,7 +1437,7 @@ sl << "replyinfo skill_info\n"; for (int i = 1; i < NUM_SKILLS; i++) - sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names[i]); + sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names [i]); if (sl.length () > MAXSOCKBUF) { @@ -1563,14 +1565,8 @@ /* figure out which skill it uses, if it uses one */ if (spell->skill) - { - for (i = 1; i < NUM_SKILLS; i++) - if (!strcmp (spell->skill, skill_names[i])) - { - skill = i + CS_STAT_SKILLINFO; - break; - } - } + if (object *tmp = pl->find_skill (spell->skill)) + skill = tmp->subtype + CS_STAT_SKILLINFO; // spells better have a face if (!spell->face)