From: terencehill Date: Thu, 11 Aug 2016 12:52:24 +0000 (+0200) Subject: Increase time from 1 to 2 of waypoints pointing out weapon spawns and show them at... X-Git-Tag: xonotic-v0.8.2~730 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=983fffdaf97ec2d7299643b14a87c754bb94107f;p=xonotic%2Fxonotic-data.pk3dir.git Increase time from 1 to 2 of waypoints pointing out weapon spawns and show them at max alpha --- diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 91869de77..638edfbff 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -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) { diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 8a787241a..aa6666e3d 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -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,