Fixed message printing on mohaas/mohaab

This commit is contained in:
smallmodel 2023-08-14 20:44:28 +02:00
parent 819f6bcf71
commit 7fb42cf655
No known key found for this signature in database
GPG key ID: A96F163ED4891440
4 changed files with 17 additions and 7 deletions

View file

@ -953,7 +953,7 @@ void G_ClientBegin(gentity_t *ent, usercmd_t *cmd)
gi.Printf("%s has entered the battle\n", ent->client->pers.netname);
}
G_PrintToAllClients(va("%s has entered the battle\n", ent->client->pers.netname));
G_PrintToAllClients(va("%s has entered the battle\n", ent->client->pers.netname), 2);
}
}

View file

@ -304,7 +304,7 @@ void G_StartCinematic(void);
void G_StopCinematic(void);
void G_CenterPrintToAllClients(const char *pszString);
void G_PrintToAllClients(const char *pszString, qboolean bBold = qtrue);
void G_PrintToAllClients(const char *pszString, int iType = 1);
void G_PrintDeathMessage(
const char *s1, const char *s2, const char *attackerName, const char *victimName, Player *victim, const char *type
);

View file

@ -1562,12 +1562,22 @@ void G_CenterPrintToAllClients(const char *pszString)
}
}
void G_PrintToAllClients(const char *pszString, qboolean bBold)
void G_PrintToAllClients(const char *pszString, int iType)
{
if (bBold) {
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_WHITE "%s\n\"", pszString);
if (g_protocol >= protocol_e::PROTOCOL_MOHTA_MIN) {
if (iType == 0) {
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_YELLOW "%s\"", pszString);
} else if (iType == 1) {
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_WHITE "%s\"", pszString);
} else if (iType == 2) {
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_CHAT_WHITE "%s\"", pszString);
}
} else {
if (iType == 0) {
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_YELLOW "%s\n\"", pszString);
} else {
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_WHITE "%s\n\"", pszString);
}
}
}

View file

@ -9045,7 +9045,7 @@ void Player::Join_DM_Team(Event *ev)
return;
}
G_PrintToAllClients(va("%s %s\n", client->pers.netname, gi.LV_ConvertString(join_message)));
G_PrintToAllClients(va("%s %s\n", client->pers.netname, gi.LV_ConvertString(join_message)), 2);
}
}