… | |
… | |
1011 | { |
1011 | { |
1012 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1012 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1013 | stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge |
1013 | stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge |
1014 | } |
1014 | } |
1015 | |
1015 | |
1016 | if (expect_false (op->has_dialogue ())) |
1016 | if (ecb_expect_false (op->has_dialogue ())) |
1017 | flags |= 1; |
1017 | flags |= 1; |
1018 | |
1018 | |
1019 | if (expect_false (op->type == PLAYER)) |
1019 | if (ecb_expect_false (op->type == PLAYER)) |
1020 | player = op == ob ? pl->ob->count |
1020 | player = op == ob ? pl->ob->count |
1021 | : op == pl->ob ? ob->count |
1021 | : op == pl->ob ? ob->count |
1022 | : op->count; |
1022 | : op->count; |
1023 | } |
1023 | } |
1024 | |
1024 | |
1025 | if (expect_false (lastcell.stat_hp != stat_hp)) |
1025 | if (ecb_expect_false (lastcell.stat_hp != stat_hp)) |
1026 | { |
1026 | { |
1027 | lastcell.stat_hp = stat_hp; |
1027 | lastcell.stat_hp = stat_hp; |
1028 | |
1028 | |
1029 | mask |= 0x8; |
1029 | mask |= 0x8; |
1030 | *last_ext |= 0x80; |
1030 | *last_ext |= 0x80; |
… | |
… | |
1039 | |
1039 | |
1040 | sl << uint8 (6) << uint8 (stat_width); |
1040 | sl << uint8 (6) << uint8 (stat_width); |
1041 | } |
1041 | } |
1042 | } |
1042 | } |
1043 | |
1043 | |
1044 | if (expect_false (lastcell.player != player)) |
1044 | if (ecb_expect_false (lastcell.player != player)) |
1045 | { |
1045 | { |
1046 | lastcell.player = player; |
1046 | lastcell.player = player; |
1047 | |
1047 | |
1048 | mask |= 0x8; |
1048 | mask |= 0x8; |
1049 | *last_ext |= 0x80; |
1049 | *last_ext |= 0x80; |
1050 | last_ext = &sl[sl.length ()]; |
1050 | last_ext = &sl[sl.length ()]; |
1051 | |
1051 | |
1052 | sl << uint8 (0x47) << uint8 (4) << (uint32)player; |
1052 | sl << uint8 (0x47) << uint8 (4) << (uint32)player; |
1053 | } |
1053 | } |
1054 | |
1054 | |
1055 | if (expect_false (lastcell.flags != flags)) |
1055 | if (ecb_expect_false (lastcell.flags != flags)) |
1056 | { |
1056 | { |
1057 | lastcell.flags = flags; |
1057 | lastcell.flags = flags; |
1058 | |
1058 | |
1059 | mask |= 0x8; |
1059 | mask |= 0x8; |
1060 | *last_ext |= 0x80; |
1060 | *last_ext |= 0x80; |
… | |
… | |
1071 | |
1071 | |
1072 | /* Middle face */ |
1072 | /* Middle face */ |
1073 | if (update_space (sl, socket, ms, lastcell, 1)) |
1073 | if (update_space (sl, socket, ms, lastcell, 1)) |
1074 | mask |= 0x2; |
1074 | mask |= 0x2; |
1075 | |
1075 | |
1076 | if (expect_false (ob->invisible) |
1076 | if (ecb_expect_false (ob->invisible) |
1077 | && ob->invisible & (ob->invisible < 50 ? 1 : 7) |
1077 | && ob->invisible & (ob->invisible < 50 ? 1 : 7) |
1078 | && ms.player () == ob) |
1078 | && ms.player () == ob) |
1079 | { |
1079 | { |
1080 | // force player to be visible to himself if invisible |
1080 | // force player to be visible to himself if invisible |
1081 | if (lastcell.faces[0] != ob->face) |
1081 | if (lastcell.faces[0] != ob->face) |