MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / BuddyProcessCommand

Function BuddyProcessCommand

Descent3/buddymenu.cpp:441–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441void 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}

Callers 1

BuddyDisplayFunction · 0.85

Calls 4

DoEditDialogFunction · 0.85
ObjGetFunction · 0.85
AINotifyFunction · 0.85

Tested by

no test coverage detected