summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-12-15 16:44:17 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-12-15 16:44:17 +0100
commit66b82a20506b53ce8dc5dde8e6ea0979a22610f0 (patch)
tree32b6e62c93e9f68a907f2095243e931614de1670 /src/game.c
parent8c086739e1344fb8789e89074dd962c5719ab030 (diff)
work
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;