diff options
| author | untodesu <kirill@untode.su> | 2025-09-12 13:33:52 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-12 13:33:52 +0500 |
| commit | e9076f22fe2a49d1cd8933e54b7b00c5dd943269 (patch) | |
| tree | 89b8a4ca1861196e067dcba218fad1d7f889b860 /game/client/session.cc | |
| parent | 68694a9c9d7d27d3b79c7b96bb67f56db2f75c45 (diff) | |
| download | voxelius-e9076f22fe2a49d1cd8933e54b7b00c5dd943269.tar.bz2 voxelius-e9076f22fe2a49d1cd8933e54b7b00c5dd943269.zip | |
It compiles
Diffstat (limited to 'game/client/session.cc')
| -rw-r--r-- | game/client/session.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/game/client/session.cc b/game/client/session.cc index 7e0d36c..c33b4d9 100644 --- a/game/client/session.cc +++ b/game/client/session.cc @@ -98,8 +98,10 @@ static void on_set_voxel_packet(const protocol::SetVoxel& packet) auto index = coord::to_index(lpos);
if(auto chunk = globals::dimension->find_chunk(cpos)) {
- if(chunk->get_voxel(index) != packet.voxel) {
- chunk->set_voxel(packet.voxel, index);
+ auto packet_voxel = world::voxel_registry::find(packet.voxel);
+
+ if(chunk->get_voxel(index) != packet_voxel) {
+ chunk->set_voxel(packet_voxel, index);
world::ChunkUpdateEvent event;
event.dimension = globals::dimension;
@@ -125,7 +127,7 @@ static void on_voxel_set(const world::VoxelSetEvent& event) // FIXME: should we also validate things here or wait for the server to do so
protocol::SetVoxel packet;
packet.vpos = coord::to_voxel(event.cpos, event.lpos);
- packet.voxel = event.voxel;
+ packet.voxel = event.voxel->get_id();
protocol::send(session::peer, protocol::encode(packet));
}
@@ -283,7 +285,7 @@ void session::send_login_request(void) {
protocol::LoginRequest packet;
packet.version = protocol::VERSION;
- packet.voxel_registry_checksum = world::voxel_registry::calculate_checksum();
+ packet.voxel_registry_checksum = world::voxel_registry::get_checksum();
packet.item_registry_checksum = world::item_registry::calculate_checksum();
packet.password_hash = server_password_hash;
packet.username = client_game::username.get();
|
