]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean out some waypoint sprite SELFPARAMs
authorMario <mario@smbclan.net>
Fri, 10 Jun 2016 10:05:27 +0000 (20:05 +1000)
committerMario <mario@smbclan.net>
Fri, 10 Jun 2016 10:05:27 +0000 (20:05 +1000)
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
qcsrc/common/physics/player.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc

index c1a72ee69da9124e1c01936d987c9bda165a456b..56b549e78107d2ee0819600f30b000bc7f679a58 100644 (file)
@@ -1045,13 +1045,14 @@ entity WaypointSprite_SpawnFixed(
 entity WaypointSprite_DeployFixed(
     entity spr,
     float limited_range,
+    entity player,
     vector ofs,
     entity icon // initial icon
 )
-{SELFPARAM();
+{
     float t;
     if (teamplay)
-        t = self.team;
+        t = player.team;
     else
         t = 0;
     float maxdistance;
@@ -1059,29 +1060,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, icon);
+    return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, player, waypointsprite_deployed_fixed, false, icon);
 }
 
 entity WaypointSprite_DeployPersonal(
     entity spr,
+    entity player,
     vector ofs,
     entity icon // initial icon
 )
-{SELFPARAM();
-    return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, false, icon);
+{
+    return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, player, waypointsprite_deployed_personal, false, icon);
 }
 
 entity WaypointSprite_Attach(
     entity spr,
+    entity player,
     float limited_range,
     entity icon // initial icon
 )
-{SELFPARAM();
+{
     float t;
-    if (self.waypointsprite_attachedforcarrier)
+    if (player.waypointsprite_attachedforcarrier)
         return world; // can't attach to FC
     if (teamplay)
-        t = self.team;
+        t = player.team;
     else
         t = 0;
     float maxdistance;
@@ -1089,7 +1092,7 @@ 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, icon);
+    return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, player, '0 0 64', world, t, player, waypointsprite_attached, false, icon);
 }
 
 entity WaypointSprite_AttachCarrier(
@@ -1113,16 +1116,16 @@ void WaypointSprite_DetachCarrier(entity carrier)
     WaypointSprite_Disown(carrier.waypointsprite_attachedforcarrier, waypointsprite_deadlifetime);
 }
 
-void WaypointSprite_ClearPersonal()
-{SELFPARAM();
-    WaypointSprite_Kill(self.waypointsprite_deployed_personal);
+void WaypointSprite_ClearPersonal(entity this)
+{
+    WaypointSprite_Kill(this.waypointsprite_deployed_personal);
 }
 
-void WaypointSprite_ClearOwned()
-{SELFPARAM();
-    WaypointSprite_Kill(self.waypointsprite_deployed_fixed);
-    WaypointSprite_Kill(self.waypointsprite_deployed_personal);
-    WaypointSprite_Kill(self.waypointsprite_attached);
+void WaypointSprite_ClearOwned(entity this)
+{
+    WaypointSprite_Kill(this.waypointsprite_deployed_fixed);
+    WaypointSprite_Kill(this.waypointsprite_deployed_personal);
+    WaypointSprite_Kill(this.waypointsprite_attached);
 }
 
 void WaypointSprite_PlayerDead(entity this)
@@ -1131,12 +1134,12 @@ void WaypointSprite_PlayerDead(entity this)
     WaypointSprite_DetachCarrier(this);
 }
 
-void WaypointSprite_PlayerGone()
-{SELFPARAM();
-    WaypointSprite_Disown(self.waypointsprite_deployed_fixed, waypointsprite_deadlifetime);
-    WaypointSprite_Kill(self.waypointsprite_deployed_personal);
-    WaypointSprite_Disown(self.waypointsprite_attached, waypointsprite_deadlifetime);
-    WaypointSprite_DetachCarrier(self);
+void WaypointSprite_PlayerGone(entity this)
+{
+    WaypointSprite_Disown(this.waypointsprite_deployed_fixed, waypointsprite_deadlifetime);
+    WaypointSprite_Kill(this.waypointsprite_deployed_personal);
+    WaypointSprite_Disown(this.waypointsprite_attached, waypointsprite_deadlifetime);
+    WaypointSprite_DetachCarrier(this);
 }
 #endif
 #endif
index 328d5b43977e46a1fe5dc135ecac6f7df181c039..7fb578f82438477dd41d19c4aa1edebb4a0978d6 100644 (file)
@@ -196,6 +196,7 @@ entity WaypointSprite_SpawnFixed(
 entity WaypointSprite_DeployFixed(
     entity spr,
     float limited_range,
+    entity player,
     vector ofs,
     entity icon // initial icon
 );
@@ -203,6 +204,7 @@ entity WaypointSprite_DeployFixed(
 .entity waypointsprite_deployed_personal;
 entity WaypointSprite_DeployPersonal(
     entity spr,
+    entity player,
     vector ofs,
     entity icon // initial icon
 );
@@ -211,6 +213,7 @@ entity WaypointSprite_DeployPersonal(
 .entity waypointsprite_attachedforcarrier;
 entity WaypointSprite_Attach(
     entity spr,
+    entity player,
     float limited_range,
     entity icon // initial icon
 );
@@ -223,13 +226,13 @@ entity WaypointSprite_AttachCarrier(
 
 void WaypointSprite_DetachCarrier(entity carrier);
 
-void WaypointSprite_ClearPersonal();
+void WaypointSprite_ClearPersonal(entity this);
 
-void WaypointSprite_ClearOwned();
+void WaypointSprite_ClearOwned(entity this);
 
 void WaypointSprite_PlayerDead(entity this);
 
-void WaypointSprite_PlayerGone();
+void WaypointSprite_PlayerGone(entity this);
 #endif
 
 #endif
index 285b2cb7f9835a65666b5dbb70773b1d5d03166b..bb81a41b930c58aa42fb72d9beeeb573f6aac6ae 100644 (file)
@@ -1552,7 +1552,7 @@ void CSQC_ClientMovement_PlayerMove_Frame(entity this)
 #endif
 {
 #ifdef SVQC
-       SELFPARAM();
+       SELFPARAM(); // needed for engine functions
 #endif
        PM_Main(this);
 }
index 3b8efff559d58683638919e4c0d8bfbe20d0ea44..d826c2a35f7e72c9b949cca84b549824f58ee80a 100644 (file)
@@ -1208,7 +1208,7 @@ void ClientDisconnect()
        if (this.chatbubbleentity) remove(this.chatbubbleentity);
        if (this.killindicator) remove(this.killindicator);
 
-       WaypointSprite_PlayerGone();
+       WaypointSprite_PlayerGone(this);
 
        bot_relinkplayerlist();
 
index 5c1e6ea60de41377d826617fd86c352d918f65c6..23ecb44c7e6b4ff4e012939182edf3f53554ebe9 100644 (file)
@@ -378,7 +378,7 @@ IMPULSE(use)
 
 IMPULSE(waypoint_personal_here)
 {
-       entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this.origin, RADARICON_WAYPOINT);
+       entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this, this.origin, RADARICON_WAYPOINT);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "personal waypoint spawned at location\n");
 }
@@ -386,7 +386,7 @@ IMPULSE(waypoint_personal_here)
 IMPULSE(waypoint_personal_crosshair)
 {
        WarpZone_crosshair_trace(this);
-       entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, trace_endpos, RADARICON_WAYPOINT);
+       entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this, trace_endpos, RADARICON_WAYPOINT);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "personal waypoint spawned at crosshair\n");
 }
@@ -394,7 +394,7 @@ IMPULSE(waypoint_personal_crosshair)
 IMPULSE(waypoint_personal_death)
 {
        if (!this.death_origin) return;
-       entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this.death_origin, RADARICON_WAYPOINT);
+       entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this, this.death_origin, RADARICON_WAYPOINT);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "personal waypoint spawned at death location\n");
 }
@@ -405,7 +405,7 @@ IMPULSE(waypoint_here_follow)
        if (IS_DEAD(this)) return;
        if (!MUTATOR_CALLHOOK(HelpMePing, this))
        {
-               entity wp = WaypointSprite_Attach(WP_Helpme, true, RADARICON_HELPME);
+               entity wp = WaypointSprite_Attach(WP_Helpme, this, true, RADARICON_HELPME);
                if (!wp) WaypointSprite_HelpMePing(this.waypointsprite_attachedforcarrier);
                else WaypointSprite_Ping(wp);
        }
@@ -414,7 +414,7 @@ IMPULSE(waypoint_here_follow)
 
 IMPULSE(waypoint_here_here)
 {
-       entity wp = WaypointSprite_DeployFixed(WP_Here, false, this.origin, RADARICON_HERE);
+       entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, this.origin, RADARICON_HERE);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "HERE spawned at location\n");
 }
@@ -422,7 +422,7 @@ IMPULSE(waypoint_here_here)
 IMPULSE(waypoint_here_crosshair)
 {
        WarpZone_crosshair_trace(this);
-       entity wp = WaypointSprite_DeployFixed(WP_Here, false, trace_endpos, RADARICON_HERE);
+       entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, trace_endpos, RADARICON_HERE);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "HERE spawned at crosshair\n");
 }
@@ -430,14 +430,14 @@ IMPULSE(waypoint_here_crosshair)
 IMPULSE(waypoint_here_death)
 {
        if (!this.death_origin) return;
-       entity wp = WaypointSprite_DeployFixed(WP_Here, false, this.death_origin, RADARICON_HERE);
+       entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, this.death_origin, RADARICON_HERE);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "HERE spawned at death location\n");
 }
 
 IMPULSE(waypoint_danger_here)
 {
-       entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this.origin, RADARICON_DANGER);
+       entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this, this.origin, RADARICON_DANGER);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "DANGER spawned at location\n");
 }
@@ -445,7 +445,7 @@ IMPULSE(waypoint_danger_here)
 IMPULSE(waypoint_danger_crosshair)
 {
        WarpZone_crosshair_trace(this);
-       entity wp = WaypointSprite_DeployFixed(WP_Danger, false, trace_endpos, RADARICON_DANGER);
+       entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this, trace_endpos, RADARICON_DANGER);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "DANGER spawned at crosshair\n");
 }
@@ -453,14 +453,14 @@ IMPULSE(waypoint_danger_crosshair)
 IMPULSE(waypoint_danger_death)
 {
        if (!this.death_origin) return;
-       entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this.death_origin, RADARICON_DANGER);
+       entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this, this.death_origin, RADARICON_DANGER);
        if (wp) WaypointSprite_Ping(wp);
        sprint(this, "DANGER spawned at death location\n");
 }
 
 IMPULSE(waypoint_clear_personal)
 {
-       WaypointSprite_ClearPersonal();
+       WaypointSprite_ClearPersonal(this);
        if (this.personal)
        {
                remove(this.personal);
@@ -471,7 +471,7 @@ IMPULSE(waypoint_clear_personal)
 
 IMPULSE(waypoint_clear)
 {
-       WaypointSprite_ClearOwned();
+       WaypointSprite_ClearOwned(this);
        if (this.personal)
        {
                remove(this.personal);