]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Change default light blue Frozen waypoint to orange Reviving waypoint when a frozen...
authorterencehill <piuntn@gmail.com>
Sat, 13 Jun 2020 17:08:25 +0000 (19:08 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 13 Jun 2020 17:08:25 +0000 (19:08 +0200)
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/mutators/mutator/waypoints/all.inc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc

index 98b20f32adbfbb8faeb4f22af5b0813b924ed8a7..92204c0c6313347d18449557439bf8ad349adbe5 100644 (file)
@@ -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;
index c8c4db546a71267d4bb86f7e71e0239ba1c7f629..daa5af4d51dff6d099a53f1cc13d299c94e899df 100644 (file)
@@ -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);
 
index bb6a68863793cb707c6d4e790bbace6a13ae6f89..d3a9806e0f05a808f8addb5384fe08b4e4ec7528 100644 (file)
@@ -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)