]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
same for WaypointSprite_AttachCarrier and WaypointSprite_Attach
authorRudolf Polzer <divverent@xonotic.org>
Tue, 21 Jun 2011 17:48:44 +0000 (19:48 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 21 Jun 2011 17:48:44 +0000 (19:48 +0200)
qcsrc/server/cl_impulse.qc
qcsrc/server/ctf.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/nexball.qc
qcsrc/server/waypointsprites.qc

index c78012bb8703710cdd3c42bf6e0da059c98f855f..c4b7370216d5eb2995210782155036439797a268 100644 (file)
@@ -159,9 +159,7 @@ void ImpulseCommands (void)
                        case 33:
                                if(self.deadflag == DEAD_NO && teamplay)
                                {
-                                       wp = WaypointSprite_Attach("helpme", TRUE);
-                                       if(wp)
-                                               WaypointSprite_UpdateTeamRadar(wp, RADARICON_HELPME, '1 0.5 0'); // TODO choose better color
+                                       wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
                                        if(!wp)
                                                wp = self.waypointsprite_attachedforcarrier; // flag sprite?
                                        if(wp)
index 27a81c8b13d5c36572466ae19d89d89d904a0934..b4356cab33e9ae546cdc2b35e9fd50f29521bce1 100644 (file)
@@ -546,8 +546,7 @@ void FlagTouch()
                self.movetype = MOVETYPE_NONE;
                setorigin(self, FLAG_CARRY_POS);
                setattachment(self, other, "");
-               WaypointSprite_AttachCarrier("flagcarrier", other);
-               WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');
+               WaypointSprite_AttachCarrier("flagcarrier", other, RADARICON_FLAGCARRIER, '1 1 0');
                WaypointSprite_Ping(self.sprite);
 
                return;
@@ -636,8 +635,7 @@ void FlagTouch()
                        setattachment(self, other, "");
                        self.damageforcescale = 0;
                        self.takedamage = DAMAGE_NO;
-                       WaypointSprite_AttachCarrier("flagcarrier", other);
-                       WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');
+                       WaypointSprite_AttachCarrier("flagcarrier", other, RADARICON_FLAGCARRIER, '1 1 0');
                }
        }
 };
index 6ec91706b78f71e77833280f55db8b33a611ecb0..e55f979960eab8c4ceb7f2acc0276e013bda7a64 100644 (file)
@@ -134,10 +134,9 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
 
        // waypoints
-       WaypointSprite_AttachCarrier("ka-ballcarrier", other);
+       WaypointSprite_AttachCarrier("ka-ballcarrier", other, RADARICON_FLAGCARRIER, '1 0 0');
        other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player;
        WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
-       WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 0 0');
        WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);   
        WaypointSprite_Kill(self.waypointsprite_attachedforcarrier);
 }
index 5a5edcc2844faf942d509677d682b10fdc3fca90..32e4116aa1273e342491fc34a48288c0d901796a 100644 (file)
@@ -350,7 +350,7 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                if(key.kh_next == world)
                {
                        // player is now a key carrier
-                       WaypointSprite_AttachCarrier("", player);
+                       WaypointSprite_AttachCarrier("", player, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));
                        player.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_KeyCarrier_waypointsprite_visible_for_player;
                        WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, player.team, SPRITERULE_TEAMPLAY);
                        if(player.team == COLOR_TEAM1)
@@ -361,7 +361,6 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-yellow", "keycarrier-friend", "keycarrier-yellow");
                        else if(player.team == COLOR_TEAM4)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-pink", "keycarrier-friend", "keycarrier-pink");
-                       WaypointSprite_UpdateTeamRadar(player.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));
                        if(!kh_no_radar_circles)
                                WaypointSprite_Ping(player.waypointsprite_attachedforcarrier);
                }
index 57bbc531ec1ebda4e04d3f0ce49974ae391faea7..1cfbbe7b73e95ebb1553a113db42eb0a05cede25 100644 (file)
@@ -166,9 +166,8 @@ void GiveBall (entity plyr, entity ball)
        ball.effects |= EF_NOSHADOW;
        ball.scale = 1; // scale down.
 
-       WaypointSprite_AttachCarrier("nb-ball", plyr);
+       WaypointSprite_AttachCarrier("nb-ball", plyr, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
        WaypointSprite_UpdateRule(plyr.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
-       WaypointSprite_UpdateTeamRadar(plyr.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
 
        if (g_nexball_basketball_delay_hold)
        {
@@ -201,7 +200,6 @@ 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, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // no health bar please
        WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
 
@@ -490,8 +488,7 @@ void SpawnBall (void)
        precache_sound (self.noise1);
        precache_sound (self.noise2);
 
-       WaypointSprite_AttachCarrier("nb-ball", self); // the ball's team is not set yet, no rule update needed
-       WaypointSprite_UpdateTeamRadar(self.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
+       WaypointSprite_AttachCarrier("nb-ball", self, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // the ball's team is not set yet, no rule update needed
 
        self.reset = ball_restart;
        self.think = InitBall;
index 2b980523e3f8a4d2521fbed58d122b20816b8e4c..eccc6cdf27e055b147ea88de221af3bd299dc201 100644 (file)
@@ -384,7 +384,8 @@ entity WaypointSprite_DeployPersonal(
 .entity waypointsprite_attachedforcarrier;
 entity WaypointSprite_Attach(
        string spr,
-       float limited_range
+       float limited_range,
+       float icon, vector rgb // initial icon and color
 )
 {
        float t, maxdistance;
@@ -398,17 +399,18 @@ 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, RADARICON_NONE, '0 0 0');
+       return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, FALSE, icon, rgb);
 }
 
 entity WaypointSprite_AttachCarrier(
        string spr,
-       entity carrier
+       entity carrier,
+       float icon, vector rgb // initial icon and color
 )
 {
        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, RADARICON_NONE, '0 0 0');
+       e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE, icon, rgb);
        if(e)
        {
                WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);