From: terencehill Date: Sat, 13 Jun 2020 17:08:25 +0000 (+0200) Subject: Change default light blue Frozen waypoint to orange Reviving waypoint when a frozen... X-Git-Tag: xonotic-v0.8.5~688^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5b6979c453328abe7d06825670a4b7d37593ea36;p=xonotic%2Fxonotic-data.pk3dir.git Change default light blue Frozen waypoint to orange Reviving waypoint when a frozen teammate is getting revived --- diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 98b20f32a..92204c0c6 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -582,8 +582,20 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) if (STAT(FROZEN, player) == FROZEN_NORMAL) { - WaypointSprite_UpdateMaxHealth(player.waypointsprite_attached, 1); - WaypointSprite_UpdateHealth(player.waypointsprite_attached, STAT(REVIVE_PROGRESS, player)); + entity player_wp = player.waypointsprite_attached; + if (n > 0 || (n == 0 && STAT(REVIVE_PROGRESS, player) > 0.95)) + { + WaypointSprite_UpdateSprites(player_wp, WP_Reviving, WP_Null, WP_Null); + WaypointSprite_UpdateTeamRadar(player_wp, RADARICON_WAYPOINT, WP_REVIVING_COLOR); + } + else + { + WaypointSprite_UpdateSprites(player_wp, WP_Frozen, WP_Null, WP_Null); + WaypointSprite_UpdateTeamRadar(player_wp, RADARICON_WAYPOINT, WP_FROZEN_COLOR); + } + + WaypointSprite_UpdateMaxHealth(player_wp, 1); + WaypointSprite_UpdateHealth(player_wp, STAT(REVIVE_PROGRESS, player)); } return true; diff --git a/qcsrc/common/mutators/mutator/waypoints/all.inc b/qcsrc/common/mutators/mutator/waypoints/all.inc index c8c4db546..daa5af4d5 100644 --- a/qcsrc/common/mutators/mutator/waypoints/all.inc +++ b/qcsrc/common/mutators/mutator/waypoints/all.inc @@ -5,7 +5,10 @@ REGISTER_WAYPOINT(Helpme, _("Help me!"), "", '1 0.5 0', 1); REGISTER_WAYPOINT(Here, _("Here"), "", '0 1 0', 1); REGISTER_WAYPOINT(Danger, _("DANGER"), "", '1 0.5 0', 1); -REGISTER_WAYPOINT(Frozen, _("Frozen!"), "", '0.25 0.90 1', 1); +const vector WP_FROZEN_COLOR = '0.25 0.9 1'; +const vector WP_REVIVING_COLOR = '1 0.5 0'; +REGISTER_WAYPOINT(Frozen, _("Frozen!"), "", WP_FROZEN_COLOR, 1); +REGISTER_WAYPOINT(Reviving, _("Reviving"), "", WP_REVIVING_COLOR, 1); REGISTER_WAYPOINT(Item, _("Item"), "", '1 0 1', 1); diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index bb6a68863..d3a9806e0 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -881,9 +881,13 @@ void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col) { // no check, as this is never called without doing an actual change (usually only once) int i = icon.m_id; - e.cnt = (e.cnt & BIT(7)) | (i & BITS(7)); - e.colormod = col; - e.SendFlags |= 32; + int new_cnt = (e.cnt & BIT(7)) | (i & BITS(7)); + if (new_cnt != e.cnt || col != e.colormod) + { + e.cnt = new_cnt; + e.colormod = col; + e.SendFlags |= 32; + } } void WaypointSprite_Ping(entity e)