]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix flag waypoint color
authorterencehill <piuntn@gmail.com>
Thu, 11 Jul 2024 16:04:19 +0000 (16:04 +0000)
committerterencehill <piuntn@gmail.com>
Thu, 11 Jul 2024 16:04:19 +0000 (16:04 +0000)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/mutators/mutator/waypoints/all.inc

index 747dbe88cbe46e1c79466685ea7b8a63524a11b5..dcdee51aee9d129acb68359c722dd8895ae390d2 100644 (file)
@@ -165,7 +165,20 @@ void ctf_FlagcarrierWaypoints(entity player)
        {
                if(!player.wps_enemyflagcarrier)
                {
-                       entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, player, FLAG_WAYPOINT_OFFSET, NULL, 0, player, wps_enemyflagcarrier, true, RADARICON_FLAG);
+                       entity base_wp = WP_FlagCarrier;
+                       if (!ctf_oneflag)
+                       {
+                               switch (player.team)
+                               {
+                                       case NUM_TEAM_1: base_wp = WP_FlagCarrierEnemyRed; break;
+                                       case NUM_TEAM_2: base_wp = WP_FlagCarrierEnemyBlue; break;
+                                       case NUM_TEAM_3: base_wp = WP_FlagCarrierEnemyYellow; break;
+                                       case NUM_TEAM_4: base_wp = WP_FlagCarrierEnemyPink; break;
+                                       default: base_wp = WP_FlagCarrierEnemyNeutral; break;
+                               }
+                       }
+                       entity wp = WaypointSprite_Spawn(base_wp, 0, 0, player, FLAG_WAYPOINT_OFFSET, NULL,
+                               0, player, wps_enemyflagcarrier, true, RADARICON_FLAG);
                        wp.colormod = WPCOLOR_ENEMYFC(player.team);
                        setcefc(wp, ctf_Stalemate_Customize);
 
@@ -371,7 +384,18 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype)
 
        // waypoints
        if(autocvar_g_ctf_flag_dropped_waypoint) {
-               entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, NULL, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG);
+               entity base_wp;
+               switch (flag.team)
+               {
+                       case NUM_TEAM_1: base_wp = WP_FlagDroppedRed; break;
+                       case NUM_TEAM_2: base_wp = WP_FlagDroppedBlue; break;
+                       case NUM_TEAM_3: base_wp = WP_FlagDroppedYellow; break;
+                       case NUM_TEAM_4: base_wp = WP_FlagDroppedPink; break;
+                       default: base_wp = WP_FlagDroppedNeutral; break;
+               }
+               int wp_team = ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team);
+               entity wp = WaypointSprite_Spawn(base_wp, 0, 0, flag, FLAG_WAYPOINT_OFFSET, NULL,
+                       wp_team, flag, wps_flagdropped, true, RADARICON_FLAG);
                wp.colormod = WPCOLOR_DROPPEDFLAG(flag.team);
        }
 
@@ -889,7 +913,20 @@ void ctf_CheckStalemate()
                {
                        if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier))
                        {
-                               entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, NULL, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG);
+                               entity base_wp = WP_FlagCarrier;
+                               if (!ctf_oneflag)
+                               {
+                                       switch (tmp_entity.owner.team)
+                                       {
+                                               case NUM_TEAM_1: base_wp = WP_FlagCarrierEnemyRed; break;
+                                               case NUM_TEAM_2: base_wp = WP_FlagCarrierEnemyBlue; break;
+                                               case NUM_TEAM_3: base_wp = WP_FlagCarrierEnemyYellow; break;
+                                               case NUM_TEAM_4: base_wp = WP_FlagCarrierEnemyPink; break;
+                                               default: base_wp = WP_FlagCarrierEnemyNeutral; break;
+                                       }
+                               }
+                               entity wp = WaypointSprite_Spawn(base_wp, 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, NULL,
+                                       0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG);
                                wp.colormod = WPCOLOR_ENEMYFC(tmp_entity.owner.team);
                                setcefc(tmp_entity.owner.wps_enemyflagcarrier, ctf_Stalemate_Customize);
                        }
index 50664831af3cf073c02b9ffbb27b8272981a63e0..da31fcb64f8edd75794c2f61afba203df9e04f6c 100644 (file)
@@ -22,13 +22,21 @@ REGISTER_WAYPOINT(AssaultDestroy, _("Destroy"), "as_destroy", '1 0.5 0', 1);
 REGISTER_WAYPOINT(AssaultPush, _("Push"), "", '1 0.5 0', 1);
 
 REGISTER_WAYPOINT(FlagCarrier, _("Flag carrier"), "", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagCarrierEnemy, _("Enemy carrier"), "flag_neutral_carrying", '1 1 1', 1);
-REGISTER_WAYPOINT(FlagDropped, _("Dropped flag"), "flag_neutral_lost", '1 1 1', 1);
-REGISTER_WAYPOINT(FlagBaseNeutral, _("White base"), "flag_neutral_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBaseRed, _("Red base"), "flag_red_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBaseBlue, _("Blue base"), "flag_blue_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBaseYellow, _("Yellow base"), "flag_yellow_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBasePink, _("Pink base"), "flag_pink_taken", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseNeutral, _("White base"),  "flag_neutral_taken", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseRed,     _("Red base"),    "flag_red_taken",     '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseBlue,    _("Blue base"),   "flag_blue_taken",    '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseYellow,  _("Yellow base"), "flag_yellow_taken",  '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBasePink,    _("Pink base"),   "flag_pink_taken",    '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagDroppedNeutral, _("Dropped flag"), "flag_neutral_lost", '1 1 1', 1);
+REGISTER_WAYPOINT(FlagDroppedRed,     _("Dropped flag"), "flag_red_lost",     '1 1 1', 1);
+REGISTER_WAYPOINT(FlagDroppedBlue,    _("Dropped flag"), "flag_blue_lost",    '1 1 1', 1);
+REGISTER_WAYPOINT(FlagDroppedYellow,  _("Dropped flag"), "flag_yellow_lost",  '1 1 1', 1);
+REGISTER_WAYPOINT(FlagDroppedPink,    _("Dropped flag"), "flag_pink_lost",    '1 1 1', 1);
+REGISTER_WAYPOINT(FlagCarrierEnemyNeutral, _("Enemy carrier"), "flag_neutral_carrying", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagCarrierEnemyRed,     _("Enemy carrier"), "flag_red_carrying",     '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagCarrierEnemyBlue,    _("Enemy carrier"), "flag_blue_carrying",    '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagCarrierEnemyYellow,  _("Enemy carrier"), "flag_yellow_carrying",  '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagCarrierEnemyPink,    _("Enemy carrier"), "flag_pink_carrying",    '0.8 0.8 0', 1);
 REGISTER_WAYPOINT(FlagReturn, _("Return flag here"), "", '0 0.8 0.8', 1);
 
 REGISTER_WAYPOINT(DomNeut, _("Control point"), "dom_icon_blue-highlighted", '0 1 1', 1);