diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/main.ha | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/client/main.ha b/client/main.ha index 0f4b1b8..081c422 100644 --- a/client/main.ha +++ b/client/main.ha @@ -119,13 +119,15 @@ export fn main() void = { const n = poll::poll(pollfd, poll::NONBLOCK)!; if (n > 0) { packet_reader::read(&packet_reader, conn)!; - for (const packet => packet_reader::next(&packet_reader)!) { - match (packet) { - case let op: packet_reader::packet_drawop => - perform_drawop(&pmgr, op); - case let packet: packet_reader::packet_sendchunk => - enact_chunkdata(&pmgr, packet, camera_pos); - }; + for (true) match (packet_reader::next(&packet_reader)) { + case done => break; + case let e: packet_reader::error => + fmt::fatalf("death: packet_reader: {}", e); + case let op: packet_reader::packet_drawop => + perform_drawop(&pmgr, op); + case let packet: packet_reader::packet_sendchunk => + enact_chunkdata(&pmgr, packet, camera_pos); + free(packet.chunk_data); }; }; |