TODO -- Call this function when the client selects a menu item
| 225 | |
| 226 | // TODO -- Call this function when the client selects a menu item |
| 227 | void MultiSendGuidebotMenuSelection(gb_com *command) { |
| 228 | int size_offset; |
| 229 | int count = 0; |
| 230 | uint8_t data[MAX_GAME_DATA_SIZE]; |
| 231 | |
| 232 | // Only process this if we are the client |
| 233 | if (Netgame.local_role != LR_CLIENT) { |
| 234 | Int3(); // We shouldn't be here... get Kevin |
| 235 | return; |
| 236 | } |
| 237 | |
| 238 | size_offset = START_DATA(MP_GUIDEBOTMENU_REQUEST, data, &count); |
| 239 | MultiAddByte(GB_MENU_REQ_SELECT, data, &count); |
| 240 | |
| 241 | MultiAddInt(command->action, data, &count); |
| 242 | MultiAddInt(command->index, data, &count); |
| 243 | |
| 244 | if (command->ptr) { |
| 245 | int len = strlen((char *)command->ptr) + 1; |
| 246 | MultiAddShort(len, data, &count); |
| 247 | memcpy(data + count, command->ptr, len); |
| 248 | count += len; |
| 249 | } else { |
| 250 | MultiAddShort(0, data, &count); |
| 251 | } |
| 252 | |
| 253 | END_DATA(count, data, size_offset); |
| 254 | nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count); |
| 255 | } |
| 256 | |
| 257 | static void MultiSendGuidebotMenuText(gb_menu *menu, int slot) { |
| 258 | int size_offset; |
no test coverage detected