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

Method DoMessage

scripts/AIGame.cpp:4600–4619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4598}
4599
4600void GuideBot::DoMessage(const char *str, bool f_high_priority, const char *sound_name, bool f_sound_2d) {
4601 if ((memory->flags & GBF_NO_CHATTER) && !f_high_priority)
4602 return;
4603
4604 if (memory->last_sound_time + 2.5f < Game_GetTime()) {
4605 if (sound_name) {
4606 int s_id = Sound_FindId(sound_name);
4607 if (f_sound_2d)
4608 Sound_Play2d(memory->me, s_id);
4609 else
4610 Sound_Play3d(memory->me, s_id);
4611 }
4612
4613 memory->last_sound_time = Game_GetTime();
4614 }
4615
4616 char gb_message[256];
4617 snprintf(gb_message, sizeof(gb_message), "\1\255\255\1%s:\1\1\255\1 %s", memory->name, str);
4618 Player_AddHudMessage(memory->my_player, gb_message);
4619}
4620
4621bool GuideBot::SetSubMode(int me, char sub_mode, int it) {
4622 switch (sub_mode) {

Callers

nothing calls this directly

Calls 2

Sound_Play2dFunction · 0.85
Sound_Play3dFunction · 0.85

Tested by

no test coverage detected