]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
merge loops in target_print
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 19 Feb 2023 10:10:47 +0000 (11:10 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 19 Feb 2023 10:21:31 +0000 (11:21 +0100)
qcsrc/server/compat/quake3.qc

index 3dd651e49bd4c1eadcfa96f65102a1f4a8b68c3b..464bd8c26091a29b491315147ca5c80f859db5c2 100644 (file)
@@ -308,20 +308,9 @@ void target_print_use(entity this, entity actor, entity trigger)
        {
                target_print_message(this, actor);
        }
-       else if(red || blue)
-       {
-               if(red)
-               {
-                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.team == NUM_TEAM_1, target_print_message(this, it));
-               }
-               if(blue)
-               {
-                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.team == NUM_TEAM_2, target_print_message(this, it));
-               }
-       }
        else
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), target_print_message(this, it));
+               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && ((!red && !blue) || (red && it.team == NUM_TEAM_1) || (blue && it.team == NUM_TEAM_2)), target_print_message(this, it));
        }
 }