From: terencehill Date: Mon, 16 Jan 2017 18:07:54 +0000 (+0100) Subject: Simplify notif_arg_missing_teams X-Git-Tag: xonotic-v0.8.2~287 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59159f9e31dac6935f80d4443230f10dc69fc657;p=xonotic%2Fxonotic-data.pk3dir.git Simplify notif_arg_missing_teams --- diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index 22f2006a7..31119e259 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -470,11 +470,11 @@ string notif_arg_frag_stats(float fhealth, float farmor, float fping) string notif_arg_missing_teams(float f1) { - return sprintf("%s%s%s%s", - ((f1 & BIT(0)) ? sprintf("%s%s", Team_ColoredFullName(NUM_TEAM_1), (f1 & (BIT(1) | BIT(2) | BIT(3)) ? ", " : "")) : ""), - ((f1 & BIT(1)) ? sprintf("%s%s", Team_ColoredFullName(NUM_TEAM_2), (f1 & ( BIT(2) | BIT(3)) ? ", " : "")) : ""), - ((f1 & BIT(2)) ? sprintf("%s%s", Team_ColoredFullName(NUM_TEAM_3), (f1 & ( BIT(3)) ? ", " : "")) : ""), - ((f1 & BIT(3)) ? Team_ColoredFullName(NUM_TEAM_4) : "") + return strcat( + ((f1 & BIT(0)) ? strcat(Team_ColoredFullName(NUM_TEAM_1), (f1 >> 1) ? ", " : "") : ""), + ((f1 & BIT(1)) ? strcat(Team_ColoredFullName(NUM_TEAM_2), (f1 >> 2) ? ", " : "") : ""), + ((f1 & BIT(2)) ? strcat(Team_ColoredFullName(NUM_TEAM_3), (f1 >> 3) ? ", " : "") : ""), + ((f1 & BIT(3)) ? Team_ColoredFullName(NUM_TEAM_4) : "") ); }