ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/request.C
(Generate patch)

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.5 by root, Sat Aug 19 02:57:05 2006 UTC vs.
Revision 1.6 by root, Sat Aug 19 03:54:23 2006 UTC

1/* 1/*
2 * static char *rcsid_init_c = 2 * static char *rcsid_init_c =
3 * "$Id: request.C,v 1.5 2006/08/19 02:57:05 root Exp $"; 3 * "$Id: request.C,v 1.6 2006/08/19 03:54:23 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
1829 lastcell.count = d; 1829 lastcell.count = d;
1830 1830
1831 if (socket.extmap) 1831 if (socket.extmap)
1832 { 1832 {
1833 uint8 stat_hp = 0; 1833 uint8 stat_hp = 0;
1834 uint8 stat_width = 0;
1834 1835
1835 // send hp information, if applicable 1836 // send hp information, if applicable
1836 if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0)) 1837 if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0))
1838 if (!op->head
1837 if (op->stats.maxhp > 0 1839 && op->stats.maxhp > 0
1838 && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp 1840 && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp
1839 && IS_LIVE (op)) 1841 && IS_LIVE (op))
1842 {
1840 stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; 1843 stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp;
1844 stat_width = op->arch->tail_x;
1845 }
1841 1846
1842 if (lastcell.stat_hp != stat_hp) 1847 if (lastcell.stat_hp != stat_hp)
1843 { 1848 {
1844 lastcell.stat_hp = stat_hp; 1849 lastcell.stat_hp = stat_hp;
1845 1850
1846 mask |= 0x8; 1851 mask |= 0x8;
1847 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 5); 1852 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 5);
1848 SockList_AddChar (&sl, stat_hp); 1853 SockList_AddChar (&sl, stat_hp);
1854
1855 if (stat_width > 1)
1856 {
1857 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 6);
1858 SockList_AddChar (&sl, stat_width);
1859 }
1849 } 1860 }
1850 } 1861 }
1851 1862
1852 /* Floor face */ 1863 /* Floor face */
1853 if (update_space(&sl, &socket, m, nx, ny, ax, ay, 2)) 1864 if (update_space(&sl, &socket, m, nx, ny, ax, ay, 2))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines