diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-15 16:44:17 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-15 16:44:17 +0100 |
| commit | 66b82a20506b53ce8dc5dde8e6ea0979a22610f0 (patch) | |
| tree | 32b6e62c93e9f68a907f2095243e931614de1670 /src/game.c | |
| parent | 8c086739e1344fb8789e89074dd962c5719ab030 (diff) | |
work
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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; |
