]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
now refactor WaypointSprite_SpawnFixed() calls too
authorRudolf Polzer <divverent@xonotic.org>
Tue, 21 Jun 2011 17:53:51 +0000 (19:53 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 21 Jun 2011 17:53:51 +0000 (19:53 +0200)
qcsrc/server/assault.qc
qcsrc/server/ctf.qc
qcsrc/server/domination.qc
qcsrc/server/mode_onslaught.qc
qcsrc/server/race.qc
qcsrc/server/waypointsprites.qc

index 3006189834d91bc722d331cb046f034ccbfd5150..2a0d8bc5374f456e9f935cc707c48ab3cd1ceb31 100644 (file)
@@ -155,7 +155,7 @@ void target_objective_decrease_activate()
                                ent.sprite = world;
                }
 
-               spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite);
+               spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite, RADARICON_OBJECTIVE, '1 0.5 0');
                spr.assault_decreaser = self;
                spr.waypointsprite_visible_for_player = assault_decreaser_sprite_visible;
                spr.classname = "sprite_waypoint";
@@ -169,7 +169,6 @@ void target_objective_decrease_activate()
                }
                else
                        WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");
-               WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');
        }
 }
 
index b4356cab33e9ae546cdc2b35e9fd50f29521bce1..7edfe9337185601a50019e2b9c6eab592eee2e92 100644 (file)
@@ -125,15 +125,9 @@ void ctf_flag_spawnstuff()
        self.basewaypoint = self.nearestwaypoint;
 
        if(self.team == COLOR_TEAM1)
-       {
-               WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 61', self, sprite);
-               WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM1 - 1, FALSE));
-       }
+               WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 61', self, sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM1 - 1, FALSE));
        else
-       {
-               WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 61', self, sprite);
-               WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM2 - 1, FALSE));
-       }
+               WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 61', self, sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM2 - 1, FALSE));
 }
 
 float ctf_score_value(string parameter)
index b58c0f074fd052ba8824c007d89293247d5ea686..93bd69a1142d176ebfa68acbd1ef6ce399f9a3de 100644 (file)
@@ -392,8 +392,7 @@ void dom_controlpoint_setup()
        droptofloor();
 
        waypoint_spawnforitem(self);
-       WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite);
-       WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');
+       WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT, '0 1 1');
 };
 
 
index ba1f8accc348c5fe2692f219531c4c6a2af78c50..c5cd4ccba417fa108dd3507282674d9cf761765c 100644 (file)
@@ -900,7 +900,7 @@ void spawnfunc_onslaught_generator()
        self.nextthink = time + 0.2;
        InitializeEntity(self, onslaught_generator_delayed, INITPRIO_LAST);
 
-       WaypointSprite_SpawnFixed(string_null, e.origin + '0 0 1' * e.maxs_z, self, sprite);
+       WaypointSprite_SpawnFixed(string_null, e.origin + '0 0 1' * e.maxs_z, self, sprite, RADARICON_NONE, '0 0 0');
        WaypointSprite_UpdateRule(self.sprite, COLOR_TEAM2, SPRITERULE_TEAMPLAY);
        WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
        WaypointSprite_UpdateHealth(self.sprite, self.health);
@@ -1283,7 +1283,7 @@ void spawnfunc_onslaught_controlpoint()
 
        waypoint_spawnforitem(self);
 
-       WaypointSprite_SpawnFixed(string_null, e.origin + '0 0 1' * e.maxs_z, self, sprite);
+       WaypointSprite_SpawnFixed(string_null, e.origin + '0 0 1' * e.maxs_z, self, sprite, RADARICON_NONE, '0 0 0');
        WaypointSprite_UpdateRule(self.sprite, COLOR_TEAM2, SPRITERULE_TEAMPLAY);
 
        onslaught_updatelinks();
index 9817b3b0e1afaa45675b4755f45989da50afe0d6..80cb96b103b45e0b77927f8c49709e919cd901f4 100644 (file)
@@ -805,9 +805,9 @@ void spawnfunc_trigger_race_checkpoint()
        if(!self.race_penalty)
        {
                if(self.race_checkpoint)
-                       WaypointSprite_SpawnFixed("race-checkpoint", o, self, sprite);
+                       WaypointSprite_SpawnFixed("race-checkpoint", o, self, sprite, RADARICON_NONE, '1 0.5 0');
                else
-                       WaypointSprite_SpawnFixed("race-finish", o, self, sprite);
+                       WaypointSprite_SpawnFixed("race-finish", o, self, sprite, RADARICON_NONE, '1 0.5 0');
        }
 
        self.sprite.waypointsprite_visible_for_player = race_waypointsprite_visible_for_player;
@@ -851,9 +851,9 @@ void spawnfunc_target_checkpoint() // defrag entity
        race_timed_checkpoint = 1;
 
        if(self.race_checkpoint == 0)
-               WaypointSprite_SpawnFixed("race-start", o, self, sprite);
+               WaypointSprite_SpawnFixed("race-start", o, self, sprite, RADARICON_NONE, '1 0.5 0');
        else
-               WaypointSprite_SpawnFixed("race-checkpoint", o, self, sprite);
+               WaypointSprite_SpawnFixed("race-checkpoint", o, self, sprite, RADARICON_NONE, '1 0.5 0');
 
        self.sprite.waypointsprite_visible_for_player = race_waypointsprite_visible_for_player;
 
index eccc6cdf27e055b147ea88de221af3bd299dc201..8308a220c97db95baebcb8083cc289c6e9ca86ff 100644 (file)
@@ -344,10 +344,11 @@ entity WaypointSprite_SpawnFixed(
        string spr,
        vector ofs,
        entity own,
-       .entity ownfield
+       .entity ownfield,
+       float icon, vector rgb // initial icon and color
 )
 {
-       return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, TRUE, 0, '0 0 0');
+       return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, TRUE, icon, rgb);
 }
 
 .entity waypointsprite_deployed_fixed;