]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/waypointsprites.qc
now CHAN_PLAYER dies
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / waypointsprites.qc
index e794c29d33ca0ba8c9e7c36b6490e5b975274245..836a853570bef941b74612a13d03d84e2d774cfc 100644 (file)
@@ -82,6 +82,7 @@ void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col)
 }
 
 .float waypointsprite_pingtime;
+.float waypointsprite_helpmetime;
 void WaypointSprite_Ping(entity e)
 {
        // anti spam
@@ -93,6 +94,15 @@ void WaypointSprite_Ping(entity e)
        e.SendFlags |= 32;
 }
 
+float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
+
+void WaypointSprite_HelpMePing(entity e)
+{
+       WaypointSprite_Ping(e);
+       e.waypointsprite_helpmetime = time + waypointsprite_deployed_lifetime;
+       e.SendFlags |= 32;
+}
+
 void WaypointSprite_FadeOutIn(entity e, float t)
 {
        if(!e.fade_time)
@@ -115,7 +125,6 @@ void WaypointSprite_FadeOutIn(entity e, float t)
        e.SendFlags |= 16;
 }
 
-float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
 void WaypointSprite_Init()
 {
        waypointsprite_limitedrange = autocvar_g_waypointsprite_limitedrange;
@@ -280,6 +289,13 @@ float WaypointSprite_SendEntity(entity to, float sendflags)
                WriteByte(MSG_ENTITY, self.colormod_x * 255.0);
                WriteByte(MSG_ENTITY, self.colormod_y * 255.0);
                WriteByte(MSG_ENTITY, self.colormod_z * 255.0);
+
+               dt = (self.waypointsprite_helpmetime - time) / 0.1;
+               if(dt < 0)
+                       dt = 0;
+               if(dt > 255)
+                       dt = 255;
+               WriteByte(MSG_ENTITY, dt);
        }
 
        return TRUE;
@@ -344,17 +360,19 @@ 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;
 entity WaypointSprite_DeployFixed(
        string spr,
        float limited_range,
-       vector ofs
+       vector ofs,
+       float icon, vector rgb // initial icon and color
 )
 {
        float t, maxdistance;
@@ -366,23 +384,25 @@ 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, RADARICON_NONE, '0 0 0');
+       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, 0, '0 0 0');
+       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;
@@ -396,17 +416,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);