Skip to content

Commit

Permalink
Preserve existing blocks during linebuild
Browse files Browse the repository at this point in the history
Close #93
  • Loading branch information
xtreme8000 committed Nov 21, 2019
1 parent f483936 commit b16c0b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/network.c
Expand Up @@ -246,10 +246,12 @@ void read_PacketBlockLine(void* data, int len) {
struct Point blocks[64];
int len = map_cube_line(p->sx,p->sy,p->sz,p->ex,p->ey,p->ez,blocks);
while(len>0) {
map_set(blocks[len-1].x,63-blocks[len-1].z,blocks[len-1].y,
players[p->player_id].block.red |
(players[p->player_id].block.green<<8) |
(players[p->player_id].block.blue<<16));
if(map_isair(blocks[len-1].x,63-blocks[len-1].z,blocks[len-1].y)) {
map_set(blocks[len-1].x,63-blocks[len-1].z,blocks[len-1].y,
players[p->player_id].block.red |
(players[p->player_id].block.green<<8) |
(players[p->player_id].block.blue<<16));
}
len--;
}
}
Expand Down

0 comments on commit b16c0b6

Please sign in to comment.