]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Increase time from 1 to 2 of waypoints pointing out weapon spawns and show them at...
authorterencehill <piuntn@gmail.com>
Thu, 11 Aug 2016 12:52:24 +0000 (14:52 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 11 Aug 2016 12:52:24 +0000 (14:52 +0200)
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/server/weapons/selection.qc

index 91869de77062531e76be4f9db6dc783948be642a..638edfbff25aac5aaed0d6b44ce59da6a936809d 100644 (file)
@@ -459,8 +459,10 @@ vector fixrgbexcess(vector rgb)
 
 void Draw_WaypointSprite(entity this)
 {
-    if (this.lifetime)
+    if (this.lifetime > 0)
         this.alpha = pow(bound(0, (this.fadetime - time) / this.lifetime, 1), waypointsprite_timealphaexponent);
+    else if (this.lifetime < 0)
+        this.alpha = (time < this.fadetime) ? 1 : 0; // no fading out effect
     else
         this.alpha = 1;
 
@@ -542,7 +544,7 @@ void Draw_WaypointSprite(entity this)
     {
         if (this.helpme && time < this.helpme)
             a *= SPRITE_HELPME_BLINK;
-        else if (!this.lifetime) // fading out waypoints don't blink
+        else if (this.lifetime > 0) // fading out waypoints don't blink
             a *= spritelookupblinkvalue(this, spriteimage);
     }
 
@@ -871,6 +873,8 @@ void WaypointSprite_FadeOutIn(entity e, float t)
         float current_fadetime;
         current_fadetime = e.teleport_time - time;
         e.teleport_time = time + t;
+        if (e.fade_time < 0)
+               e.fade_time = -e.fade_time;
         e.fade_time = e.fade_time * t / current_fadetime;
     }
 
@@ -1004,8 +1008,10 @@ entity WaypointSprite_Spawn(
 )
 {
     entity wp = new(sprite_waypoint);
+    wp.fade_time = _lifetime; // if negative tells client not to fade it out
+    if(_lifetime < 0)
+       _lifetime = -_lifetime;
     wp.teleport_time = time + _lifetime;
-    wp.fade_time = _lifetime;
     wp.exteriormodeltoclient = ref;
     if (ref)
     {
index 8a787241a095695376a8879484d6c8c7390c7b07..aa6666e3db20a76dfb15234519e796b8f39ac365 100644 (file)
@@ -29,7 +29,7 @@ void Weapon_whereis(Weapon this, entity cl)
                        continue;
                entity wp = WaypointSprite_Spawn(
                        WP_Weapon,
-                       1, 0,
+                       -2, 0,
                        NULL, it.origin + ('0 0 1' * it.maxs.z) * 1.2,
                        cl, 0,
                        NULL, enemy,