summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
index 1999815..df65282 100644
--- a/src/game.c
+++ b/src/game.c
@@ -174,6 +174,11 @@ void update_server(platform_window* window) {
} break;
+ case MESSAGE_USER_THROW: {
+ protocol_user_throw* throw_msg = (protocol_user_throw*)msg->message;
+ throw_throwable(throw_msg->id, throw_msg->throwable, throw_msg->dirx, throw_msg->diry);
+ } break;
+
case MESSAGE_USER_MOVED: {
protocol_move* move_msg = (protocol_move*)msg->message;
move_user(window, move_msg->id, move_msg->move, move_msg->delta);
@@ -225,6 +230,7 @@ void update_server(platform_window* window) {
broadcast_to_clients(create_protocol_zombie_list());
broadcast_to_clients(create_protocol_bullets_list());
broadcast_to_clients(create_protocol_drop_list());
+ broadcast_to_clients(create_protocol_throwables_list());
// play sounds locally and send them to clients.
play_sounds_in_queue();
@@ -286,6 +292,11 @@ void update_client(platform_window* window) {
memcpy(zombies, msg_zombies->zombies, sizeof(zombies));
} break;
+ case MESSAGE_THROWABLES_LIST: {
+ protocol_throwables_list* msg_throwables = (protocol_throwables_list*)msg;
+ memcpy(throwables, msg_throwables->throwables, sizeof(throwables));
+ } break;
+
case MESSAGE_BULLET_LIST: {
protocol_bullets_list* msg_bullets = (protocol_bullets_list*)msg;
load_bullets_into_existing_list(msg_bullets);