]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
waypointsprites: always add color to WaypointSprite_Spawn()
authorRudolf Polzer <divverent@xonotic.org>
Tue, 21 Jun 2011 17:21:05 +0000 (19:21 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 21 Jun 2011 17:21:05 +0000 (19:21 +0200)
qcsrc/common/constants.qh
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/ctf.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/nexball.qc
qcsrc/server/t_items.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/w_seeker.qc
qcsrc/server/waypointsprites.qc

index 4db7ea675166cb15d9963aeb0f9f44b1719aaac6..132021aa8813efce06b48ca2a47624c83fbb2532 100644 (file)
@@ -125,6 +125,7 @@ const float ENT_CLIENT_VEHICLE = 60;
 const float SPRITERULE_DEFAULT = 0;
 const float SPRITERULE_TEAMPLAY = 1;
 
+const float RADARICON_NONE = 0;
 const float RADARICON_FLAG = 1;
 const float RADARICON_FLAGCARRIER = 1;
 const float RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them
index 15894f6df0bc009f2c727f49b15bd2c252580806..500132f0bdf26af7e5ddaa8246a17cedcce20d38 100644 (file)
@@ -986,7 +986,8 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                                                world, e.origin,
                                                self, 0,
                                                world, enemy,
-                                               0
+                                               0,
+                                               RADARICON_NONE, '0 0 0'
                                        );
                                }
                        }
index c3676ff45c6f5ffd08b3ab6646c8f46f4f9fd913..27a81c8b13d5c36572466ae19d89d89d904a0934 100644 (file)
@@ -296,8 +296,7 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
        ctf_captureshield_update(p, 0); // shield only
        e.playerid = attacker.playerid;
        e.ctf_droptime = time;
-       WaypointSprite_Spawn("flagdropped", 0, 0, e, '0 0 1' * 61, world, COLOR_TEAM1 + COLOR_TEAM2 - e.team, e, waypointsprite_attachedforcarrier, FALSE);
-       WaypointSprite_UpdateTeamRadar(e.waypointsprite_attachedforcarrier, RADARICON_FLAG, '0 1 1');
+       WaypointSprite_Spawn("flagdropped", 0, 0, e, '0 0 1' * 61, world, COLOR_TEAM1 + COLOR_TEAM2 - e.team, e, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAG, '0 1 1');
        WaypointSprite_Ping(e.waypointsprite_attachedforcarrier);
        
        if(p.waypointsprite_attachedforcarrier)
index f56dc59f18f15979d5cdd8e5defb06826babdaf9..c3d9272598fa720683113018f14efc241237ab8d 100644 (file)
@@ -88,11 +88,7 @@ void freezetag_Freeze(entity attacker)
        RemoveGrapplingHook(self);
 
        // add waypoint
-       WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE);
-       if(self.waypointsprite_attached)
-       {
-               WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_WAYPOINT, '0.25 0.90 1');
-       }
+       WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE, RADARICON_WAYPOINT, '0.25 0.90 1');
 
        if(attacker == self)
        {
index 1d091b1156763ddf1c1b49d6ffbc0b0fda98b4f0..6ec91706b78f71e77833280f55db8b33a611ecb0 100644 (file)
@@ -75,8 +75,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
                pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
                pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
 
-               WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE);
-               WaypointSprite_UpdateTeamRadar(self.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '0 1 1');
+               WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
                WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);    
 
                sound(self, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
@@ -178,9 +177,8 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
        
        // waypoints
-       WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE);
+       WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
        WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
-       WaypointSprite_UpdateTeamRadar(ball.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '0 1 1');
        WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);    
        WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
 }
index 85623f79d8a3a17518177b351f5f79aa788e205d..5a5edcc2844faf942d509677d682b10fdc3fca90 100644 (file)
@@ -751,9 +751,8 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
 
        centerprint(initial_owner, strcat("You are starting with the ", key.netname, "\n"));  // message to player at start of round
 
-       WaypointSprite_Spawn("key-dropped", 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, FALSE);
+       WaypointSprite_Spawn("key-dropped", 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAG, '0 1 1');
        key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player;
-       WaypointSprite_UpdateTeamRadar(key.waypointsprite_attachedforcarrier, RADARICON_FLAG, '0 1 1');
 
        kh_Key_AssignTo(key, initial_owner);
 }
index 13e8eea40a9103424f89eb187af775d0903f247f..57bbc531ec1ebda4e04d3f0ce49974ae391faea7 100644 (file)
@@ -202,9 +202,8 @@ void DropBall (entity ball, vector org, vector vel)
 
        WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier);
        //WaypointSprite_AttachCarrier("nb-ball", ball);
-       WaypointSprite_Spawn("nb-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE); // no health bar please
+       WaypointSprite_Spawn("nb-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // no health bar please
        WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
-       WaypointSprite_UpdateTeamRadar(ball.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
 
        ball.owner.ballcarried = world;
        ball.owner = world;
index 5a591e03532d7ab0847c1c2ec656b900abb9c485..02660fc52a97c8f291f98d4728a92053ae9d563a 100644 (file)
@@ -198,13 +198,9 @@ void Item_RespawnCountdown (void)
                        }
                        if(name)
                        {
-                               WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE);
+                               WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
                                if(self.waypointsprite_attached)
-                               {
-                                       WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, rgb);
-                                       //WaypointSprite_UpdateMaxHealth(self.waypointsprite_attached, ITEM_RESPAWN_TICKS + 1);
                                        WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
-                               }
                        }
                }
                sound (self, CHAN_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM);       // play respawn sound
index 820c2ecbd61b8ea7ed21a984ae44edd25efc5891..db22ae42a66bab560c72d94e5e48e7d838630357 100644 (file)
@@ -785,6 +785,7 @@ void vehicles_showwp_goaway()
 void vehicles_showwp()
 {
     entity oldself;
+    vector rgb;
     
     if(self.cnt)
     {        
@@ -807,18 +808,16 @@ void vehicles_showwp()
         self.think = vehicles_showwp_goaway;
     }
     
-    WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE);
+    if(teamplay && self.team)
+           rgb = TeamColor(self.team);
+    else
+           rgb = '1 1 1';
+    WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
     if(self.waypointsprite_attached)
     {        
-        if(teamplay && self.team)
-            WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, TeamColor(self.team));
-        else
-            WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, '1 1 1');
-        
         WaypointSprite_UpdateRule(self.waypointsprite_attached, self.enemy.team, SPRITERULE_DEFAULT);        
         if(oldself == world)
             WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);        
-            
         WaypointSprite_Ping(self.waypointsprite_attached);
     }    
     
index 890363da61747e3c8f1de9eb68f297489430bae5..74ac14550e9bde827e1d10804bb05bb442d818b4 100644 (file)
@@ -454,8 +454,7 @@ void Seeker_Tag_Touch()
                
                if      (autocvar_g_balance_seeker_type == 1)
                {
-                       WaypointSprite_Spawn("tagged-target", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.owner, 0, other, wps_tag_tracker, TRUE);
-                       WaypointSprite_UpdateTeamRadar(other.wps_tag_tracker, RADARICON_TAGGED, '0.5 1 0');
+                       WaypointSprite_Spawn("tagged-target", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.owner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0');
                        WaypointSprite_UpdateRule(other.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
                }
        }
index 24fdcb336729c9ed81f9731a67fcfc20167e85e7..e794c29d33ca0ba8c9e7c36b6490e5b975274245 100644 (file)
@@ -299,7 +299,8 @@ entity WaypointSprite_Spawn(
        entity ref, vector ofs, // position
        entity showto, float t, // show to whom? Use a flag to indicate a team
        entity own, .entity ownfield, // remove when own gets killed
-       float hideable // true when it should be controlled by cl_hidewaypoints
+       float hideable, // true when it should be controlled by cl_hidewaypoints
+       float icon, vector rgb // initial icon and color
 )
 {
        entity wp;
@@ -333,6 +334,8 @@ entity WaypointSprite_Spawn(
        wp.customizeentityforclient = WaypointSprite_Customize;
        wp.waypointsprite_visible_for_player = WaypointSprite_visible_for_player;
        wp.reset2 = WaypointSprite_Reset;
+       wp.cnt = icon;
+       wp.colormod = rgb;
        Net_LinkEntity(wp, FALSE, 0, WaypointSprite_SendEntity);
        return wp;
 }
@@ -344,7 +347,7 @@ entity WaypointSprite_SpawnFixed(
        .entity ownfield
 )
 {
-       return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, TRUE);
+       return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, TRUE, 0, '0 0 0');
 }
 
 .entity waypointsprite_deployed_fixed;
@@ -363,7 +366,7 @@ entity WaypointSprite_DeployFixed(
                maxdistance = waypointsprite_limitedrange;
        else
                maxdistance = 0;
-       return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, self, waypointsprite_deployed_fixed, FALSE);
+       return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, self, waypointsprite_deployed_fixed, FALSE, RADARICON_NONE, '0 0 0');
 }
 
 .entity waypointsprite_deployed_personal;
@@ -372,7 +375,7 @@ entity WaypointSprite_DeployPersonal(
        vector ofs
 )
 {
-       return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, FALSE);
+       return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, FALSE, 0, '0 0 0');
 }
 
 .entity waypointsprite_attached;
@@ -393,7 +396,7 @@ entity WaypointSprite_Attach(
                maxdistance = waypointsprite_limitedrange;
        else
                maxdistance = 0;
-       return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, FALSE);
+       return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, FALSE, RADARICON_NONE, '0 0 0');
 }
 
 entity WaypointSprite_AttachCarrier(
@@ -403,7 +406,7 @@ entity WaypointSprite_AttachCarrier(
 {
        entity e;
        WaypointSprite_Kill(carrier.waypointsprite_attached); // FC overrides attached
-       e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE);
+       e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE, RADARICON_NONE, '0 0 0');
        if(e)
        {
                WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);