--- deliantra/server/socket/request.C 2006/08/21 07:13:32 1.7 +++ deliantra/server/socket/request.C 2006/08/25 17:11:54 1.10 @@ -1,6 +1,6 @@ /* * static char *rcsid_init_c = - * "$Id: request.C,v 1.7 2006/08/21 07:13:32 root Exp $"; + * "$Id: request.C,v 1.10 2006/08/25 17:11:54 root Exp $"; */ /* @@ -235,7 +235,7 @@ void ExtCmd (char *buf, int len, player *pl) { - execute_global_event (EVENT_EXTCMD, pl, buf, len); + INVOKE_PLAYER (EXTCMD, pl, ARG_DATA (buf, len)); } void MapInfoCmd (char *buf, int len, player *pl) @@ -1294,6 +1294,7 @@ cell->faces[2] = face2; cell->count = count; cell->stat_hp = 0; + cell->player = 0; } #define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y) @@ -1849,21 +1850,33 @@ if (socket.extmap) { - uint8 stat_hp = 0; + uint8 stat_hp = 0; uint8 stat_width = 0; + tag_t player = 0; // send hp information, if applicable if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0)) - if (!op->head - && op->stats.maxhp > 0 - && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp - && IS_LIVE (op)) - { - stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; - stat_width = op->arch->tail_x; - } + { + if (op->head || op->invisible) + ; // do not show + else if (op->type == PLAYER + || QUERY_FLAG (op, FLAG_MONSTER) + || QUERY_FLAG (op, FLAG_ALIVE) + || QUERY_FLAG (op, FLAG_GENERATOR)) + { + if (op->stats.maxhp > 0 + && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp) + { + stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; + stat_width = op->arch->tail_x; + } + } + + if (op->type == PLAYER && op != pl) + player = op->count; + } - if (lastcell.stat_hp != stat_hp) + if (lastcell.stat_hp != stat_hp && 0) { lastcell.stat_hp = stat_hp; @@ -1877,6 +1890,15 @@ SockList_AddChar (&sl, stat_width); } } + + if (lastcell.player != player && 0) + { + lastcell.player = player; + mask |= 0x8; + *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 0x47); + SockList_AddChar (&sl, 4); + SockList_AddInt (&sl, player); + } } /* Floor face */