X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fwaypointsprites.qc;h=8308a220c97db95baebcb8083cc289c6e9ca86ff;hb=0068e05a7894e43425cbe6328e5ec45e83e07380;hp=5bbf02676f7a16e29a6b1e7dbbd19a0d80bf65d1;hpb=d7a834f0cfbf327e001d53f09c7ddfe2e2783955;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/waypointsprites.qc b/qcsrc/server/waypointsprites.qc index 5bbf02676..8308a220c 100644 --- a/qcsrc/server/waypointsprites.qc +++ b/qcsrc/server/waypointsprites.qc @@ -81,8 +81,13 @@ void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col) e.SendFlags |= 32; } +.float waypointsprite_pingtime; void WaypointSprite_Ping(entity e) { + // anti spam + if(time < e.waypointsprite_pingtime) + return; + e.waypointsprite_pingtime = time + 0.3; // ALWAYS sends (this causes a radar circle), thus no check e.cnt |= 0x80; e.SendFlags |= 32; @@ -294,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; @@ -328,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; } @@ -336,21 +344,23 @@ 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); + return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, TRUE, icon, rgb); } .entity waypointsprite_deployed_fixed; entity WaypointSprite_DeployFixed( string spr, float limited_range, - vector ofs + vector ofs, + float icon, vector rgb // initial icon and color ) { float t, maxdistance; - if(teams_matter) + if(teamplay) t = self.team; else t = 0; @@ -358,29 +368,31 @@ 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, icon, rgb); } .entity waypointsprite_deployed_personal; entity WaypointSprite_DeployPersonal( string spr, - vector ofs + vector ofs, + float icon, vector rgb // initial icon and color ) { - 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, icon, rgb); } .entity waypointsprite_attached; .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; if(self.waypointsprite_attachedforcarrier) return world; // can't attach to FC - if(teams_matter) + if(teamplay) t = self.team; else t = 0; @@ -388,17 +400,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); + 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); + 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);