1 | /* |
1 | /* |
2 | * static char *rcsid_init_c = |
2 | * static char *rcsid_init_c = |
3 | * "$Id: request.C,v 1.8 2006/08/24 10:58:39 root Exp $"; |
3 | * "$Id: request.C,v 1.9 2006/08/24 17:29:30 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
1292 | cell->faces[0] = face0; |
1292 | cell->faces[0] = face0; |
1293 | cell->faces[1] = face1; |
1293 | cell->faces[1] = face1; |
1294 | cell->faces[2] = face2; |
1294 | cell->faces[2] = face2; |
1295 | cell->count = count; |
1295 | cell->count = count; |
1296 | cell->stat_hp = 0; |
1296 | cell->stat_hp = 0; |
|
|
1297 | cell->player = 0; |
1297 | } |
1298 | } |
1298 | |
1299 | |
1299 | #define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y) |
1300 | #define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y) |
1300 | #define MAX_LAYERS 3 |
1301 | #define MAX_LAYERS 3 |
1301 | |
1302 | |
… | |
… | |
1855 | |
1856 | |
1856 | // send hp information, if applicable |
1857 | // send hp information, if applicable |
1857 | if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0)) |
1858 | if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0)) |
1858 | { |
1859 | { |
1859 | if (op->head || op->invisible) |
1860 | if (op->head || op->invisible) |
1860 | continue; |
1861 | ; // do not show |
1861 | |
|
|
1862 | if (op->type == PLAYER |
1862 | else if (op->type == PLAYER |
1863 | || QUERY_FLAG(op, FLAG_MONSTER) |
1863 | || QUERY_FLAG (op, FLAG_MONSTER) |
1864 | || QUERY_FLAG(op, FLAG_ALIVE) |
1864 | || QUERY_FLAG (op, FLAG_ALIVE) |
1865 | || QUERY_FLAG(op, FLAG_GENERATOR)) |
1865 | || QUERY_FLAG (op, FLAG_GENERATOR)) |
1866 | { |
1866 | { |
1867 | if (op->stats.maxhp > 0 |
1867 | if (op->stats.maxhp > 0 |
1868 | && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp) |
1868 | && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp) |
1869 | { |
1869 | { |
1870 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1870 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
… | |
… | |
1874 | |
1874 | |
1875 | if (op->type == PLAYER && op != pl) |
1875 | if (op->type == PLAYER && op != pl) |
1876 | player = op->count; |
1876 | player = op->count; |
1877 | } |
1877 | } |
1878 | |
1878 | |
1879 | if (lastcell.stat_hp != stat_hp) |
1879 | if (lastcell.stat_hp != stat_hp && 0) |
1880 | { |
1880 | { |
1881 | lastcell.stat_hp = stat_hp; |
1881 | lastcell.stat_hp = stat_hp; |
1882 | |
1882 | |
1883 | mask |= 0x8; |
1883 | mask |= 0x8; |
1884 | *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 5); |
1884 | *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 5); |
… | |
… | |
1889 | *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 6); |
1889 | *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 6); |
1890 | SockList_AddChar (&sl, stat_width); |
1890 | SockList_AddChar (&sl, stat_width); |
1891 | } |
1891 | } |
1892 | } |
1892 | } |
1893 | |
1893 | |
1894 | if (lastcell.player != player) |
1894 | if (lastcell.player != player && 0) |
1895 | { |
1895 | { |
1896 | lastcell.player = player; |
1896 | lastcell.player = player; |
1897 | mask |= 0x8; |
1897 | mask |= 0x8; |
1898 | *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 0x47); |
1898 | *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 0x47); |
1899 | SockList_AddChar (&sl, 4); |
1899 | SockList_AddChar (&sl, 4); |