| 439 | } |
| 440 | |
| 441 | void BuddyProcessCommand(int res) { |
| 442 | gb_com command; |
| 443 | char answer[8]; |
| 444 | |
| 445 | int index = res - UID_BUDDYCMD; |
| 446 | |
| 447 | command.action = COM_DO_ACTION; |
| 448 | command.index = Guidebot_menu_data.command_id[index]; |
| 449 | if (Guidebot_menu_data.command_type[index] == GBCT_STRING_DIALOG) { |
| 450 | answer[0] = '\0'; |
| 451 | |
| 452 | DoEditDialog(Guidebot_menu_data.dialog_text[index], answer, sizeof(answer) - 1); |
| 453 | command.ptr = (void *)answer; |
| 454 | } else { |
| 455 | command.ptr = NULL; |
| 456 | } |
| 457 | |
| 458 | if ((!(Game_mode & GM_MULTI)) || (Netgame.local_role != LR_CLIENT)) { |
| 459 | object *b_obj = ObjGet(Buddy_handle[Player_object->id]); |
| 460 | ASSERT(b_obj); |
| 461 | |
| 462 | AINotify(b_obj, AIN_USER_DEFINED, (void *)&command); |
| 463 | } else { |
| 464 | MultiSendGuidebotMenuSelection(&command); |
| 465 | } |
| 466 | } |
no test coverage detected