… | |
… | |
635 | |
635 | |
636 | mapcell *cell = map_get_cell (self, x, y); |
636 | mapcell *cell = map_get_cell (self, x, y); |
637 | |
637 | |
638 | if (flags & 15) |
638 | if (flags & 15) |
639 | { |
639 | { |
640 | if (cell->darkness < 0) // && x < self->w && y < self->h) |
640 | if (cell->darkness < 0) |
641 | { |
641 | { |
642 | cell->darkness = 0; |
642 | cell->darkness = 0; |
643 | cell->face [0] = 0; |
643 | cell->face [0] = 0; |
644 | cell->face [1] = 0; |
644 | cell->face [1] = 0; |
645 | cell->face [2] = 0; |
645 | cell->face [2] = 0; |
646 | } |
646 | } |
647 | |
647 | |
648 | cell->darkness = flags & 8 ? *data++ : 255; |
648 | cell->darkness = flags & 8 ? *data++ : 255; |
649 | |
649 | |
650 | //TODO: don't trust server data to be in-range(!) |
650 | //TODO: don't trust server data to be in-range(!) |
651 | |
651 | |
652 | if (flags & 4) |
652 | if (flags & 4) |