From 66b82a20506b53ce8dc5dde8e6ea0979a22610f0 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Thu, 15 Dec 2022 16:44:17 +0100 Subject: work --- src/game.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index fe4bf63..9d70d33 100644 --- a/src/game.c +++ b/src/game.c @@ -161,6 +161,7 @@ void update_server(platform_window* window) { broadcast_to_clients(create_protocol_user_list()); broadcast_to_clients(create_protocol_zombie_list()); broadcast_to_clients(create_protocol_bullets_list()); + broadcast_to_clients(create_protocol_drop_list()); update_timer = 0.0f; } @@ -205,7 +206,7 @@ void update_client(platform_window* window) { case MESSAGE_ZOMBIE_LIST: { if (global_state.server) break; // zombies are simulated on server so dont overwrite data. protocol_zombie_list* msg_zombies = (protocol_zombie_list*)msg; - memcpy(zombies, msg_zombies->zombies, sizeof(zombies)); + memcpy(zombies, msg_zombies->zombies, sizeof(zombies)); } break; case MESSAGE_BULLET_LIST: { @@ -213,6 +214,12 @@ void update_client(platform_window* window) { protocol_bullets_list* msg_bullets = (protocol_bullets_list*)msg; memcpy(bullets, msg_bullets->bullets, sizeof(bullets)); } break; + + case MESSAGE_DROP_LIST: { + if (global_state.server) break; // drops are simulated on server so dont overwrite data. + protocol_drop_list* msg_drops = (protocol_drop_list*)msg; + memcpy(drops, msg_drops->drops, sizeof(drops)); + } break; default: log_info("Unhandled message received"); break; -- cgit v1.2.3-70-g09d2