summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c9
1 files changed, 8 insertions, 1 deletions
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;