From: Rudolf Polzer Date: Tue, 21 Jun 2011 17:53:51 +0000 (+0200) Subject: now refactor WaypointSprite_SpawnFixed() calls too X-Git-Tag: xonotic-v0.5.0~199^2~6 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=0068e05a7894e43425cbe6328e5ec45e83e07380;p=xonotic%2Fxonotic-data.pk3dir.git now refactor WaypointSprite_SpawnFixed() calls too --- diff --git a/qcsrc/server/assault.qc b/qcsrc/server/assault.qc index 300618983..2a0d8bc53 100644 --- a/qcsrc/server/assault.qc +++ b/qcsrc/server/assault.qc @@ -155,7 +155,7 @@ void target_objective_decrease_activate() ent.sprite = world; } - spr = WaypointSprite_SpawnFixed("", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite); + spr = WaypointSprite_SpawnFixed("", 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'); } } diff --git a/qcsrc/server/ctf.qc b/qcsrc/server/ctf.qc index b4356cab3..7edfe9337 100644 --- a/qcsrc/server/ctf.qc +++ b/qcsrc/server/ctf.qc @@ -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) diff --git a/qcsrc/server/domination.qc b/qcsrc/server/domination.qc index b58c0f074..93bd69a11 100644 --- a/qcsrc/server/domination.qc +++ b/qcsrc/server/domination.qc @@ -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'); }; diff --git a/qcsrc/server/mode_onslaught.qc b/qcsrc/server/mode_onslaught.qc index ba1f8accc..c5cd4ccba 100644 --- a/qcsrc/server/mode_onslaught.qc +++ b/qcsrc/server/mode_onslaught.qc @@ -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(); diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 9817b3b0e..80cb96b10 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -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; diff --git a/qcsrc/server/waypointsprites.qc b/qcsrc/server/waypointsprites.qc index eccc6cdf2..8308a220c 100644 --- a/qcsrc/server/waypointsprites.qc +++ b/qcsrc/server/waypointsprites.qc @@ -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;