From: terencehill Date: Thu, 11 Jul 2024 16:04:19 +0000 (+0000) Subject: Fix flag waypoint color X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e38d06c4fb9bb4db51917b17c22f355c11565dda;p=xonotic%2Fxonotic-data.pk3dir.git Fix flag waypoint color --- diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index 747dbe88c..dcdee51ae 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -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); } diff --git a/qcsrc/common/mutators/mutator/waypoints/all.inc b/qcsrc/common/mutators/mutator/waypoints/all.inc index 50664831a..da31fcb64 100644 --- a/qcsrc/common/mutators/mutator/waypoints/all.inc +++ b/qcsrc/common/mutators/mutator/waypoints/all.inc @@ -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);