]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Purge other from customizeentityforclient
authorMario <mario@smbclan.net>
Sun, 19 Jun 2016 17:02:26 +0000 (03:02 +1000)
committerMario <mario@smbclan.net>
Sun, 19 Jun 2016 17:02:26 +0000 (03:02 +1000)
16 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/minigames/sv_minigames.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
qcsrc/lib/net.qh
qcsrc/lib/self.qh
qcsrc/server/g_subs.qc
qcsrc/server/g_subs.qh
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/portals.qc
qcsrc/server/weapons/weaponsystem.qc

index 2668f7e19615a46ca2375be87b9676ca160b49af..dde20f26c7312777fdf4514fad119ab5b6e09206 100644 (file)
@@ -609,11 +609,10 @@ spawnfunc(nexball_football)
        SpawnBall(this);
 }
 
-float nb_Goal_Customize(entity this)
+bool nb_Goal_Customize(entity this, entity client)
 {
-       entity e, wp_owner;
-       e = WaypointSprite_getviewentity(other);
-       wp_owner = this.owner;
+       entity e = WaypointSprite_getviewentity(client);
+       entity wp_owner = this.owner;
        if(SAME_TEAM(e, wp_owner)) { return false; }
 
        return true;
@@ -838,7 +837,7 @@ void W_Nexball_Attack2(entity actor)
        CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
 }
 
-float ball_customize(entity this)
+bool ball_customize(entity this, entity client)
 {
        if(!this.owner)
        {
@@ -848,7 +847,7 @@ float ball_customize(entity this)
                return true;
        }
 
-       if(other == this.owner)
+       if(client == this.owner)
        {
                this.scale = autocvar_g_nexball_viewmodel_scale;
                if(this.enemy)
index d2a070f273f3f3566f661ad19d917c826cff0412..7d9c93d94c24f2602ed0e83f2e115ef10a2dd133 100644 (file)
@@ -162,9 +162,9 @@ void FixSize(entity e);
 // CaptureShield Functions
 // =======================
 
-bool ons_CaptureShield_Customize(entity this)
+bool ons_CaptureShield_Customize(entity this, entity client)
 {
-       entity e = WaypointSprite_getviewentity(other);
+       entity e = WaypointSprite_getviewentity(client);
 
        if(!this.enemy.isshielded && (ons_ControlPoint_Attackable(this.enemy, e.team) > 0 || this.enemy.classname != "onslaught_controlpoint")) { return false; }
        if(SAME_TEAM(this, e)) { return false; }
index 689ce83d0295968e7e1ede2e3923fdeb4ed53465..992eab054b0b6aa1fe3a497080b50e10ee0a8e64 100644 (file)
@@ -112,11 +112,11 @@ void minigame_resend(entity minigame)
        }
 }
 
-bool minigame_CheckSend(entity this)
+bool minigame_CheckSend(entity this, entity client)
 {
        entity e;
        for ( e = this.owner.minigame_players; e != NULL; e = e.list_next )
-               if ( e.minigame_players == other )
+               if ( e.minigame_players == client )
                        return true;
        return false;
 }
index 70c9bf80581c05e797ae76b79cc3d2a69ebc649b..de9e3f69610d41b3a42b3eeb5ac1fffc01c99914 100644 (file)
@@ -24,7 +24,7 @@ void end_minigames();
 
 // Only sends entities to players who joined the minigame
 // Use on customizeentityforclient for gameplay entities
-bool minigame_CheckSend(entity this);
+bool minigame_CheckSend(entity this, entity client);
 
 // Check for minigame impulses
 bool MinigameImpulse(entity this, int imp);
index c1ff98b677d7e86708f8128139488acb83415d29..de32df9683483ab1f9d4280f558e20b30cdd5ef2 100644 (file)
@@ -92,12 +92,12 @@ REGISTER_MUTATOR(buffs, cvar("g_buffs"))
        }
 }
 
-bool buffs_BuffModel_Customize(entity this)
+bool buffs_BuffModel_Customize(entity this, entity client)
 {
        entity player, myowner;
        bool same_team;
 
-       player = WaypointSprite_getviewentity(other);
+       player = WaypointSprite_getviewentity(client);
        myowner = this.owner;
        same_team = (SAME_TEAM(player, myowner) || SAME_TEAM(player, myowner));
 
@@ -107,7 +107,7 @@ bool buffs_BuffModel_Customize(entity this)
        if(MUTATOR_CALLHOOK(BuffModel_Customize, this, player))
                return false;
 
-       if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
+       if(player == myowner || (IS_SPEC(client) && client.enemy == myowner))
        {
                // somewhat hide the model, but keep the glow
                this.effects = 0;
@@ -390,9 +390,9 @@ void buff_Reset(entity this)
                buff_Respawn(this);
 }
 
-float buff_Customize(entity this)
+bool buff_Customize(entity this, entity client)
 {
-       entity player = WaypointSprite_getviewentity(other);
+       entity player = WaypointSprite_getviewentity(client);
        if(!this.buff_active || (this.team && DIFF_TEAM(player, this)))
        {
                this.alpha = 0.3;
index d9f4a396a2994657133ec75f8b1f1a7ebc8dadb6..353baa96097b22fae19f3185d94217afc7b1db11 100644 (file)
@@ -999,10 +999,10 @@ MUTATOR_HOOKFUNCTION(nades, PutClientInServer)
        nades_RemoveBonus(player);
 }
 
-float nade_customize(entity this)
+bool nade_customize(entity this, entity client)
 {
-       //if(IS_SPEC(other)) { return false; }
-       if(other == this.exteriormodeltoclient || (IS_SPEC(other) && other.enemy == this.exteriormodeltoclient))
+       //if(IS_SPEC(client)) { return false; }
+       if(client == this.exteriormodeltoclient || (IS_SPEC(client) && client.enemy == this.exteriormodeltoclient))
        {
                // somewhat hide the model, but keep the glow
                //this.effects = 0;
index 5fdb7ec428535661a7f8a40ab685aa034dfe2d88..0cd163386b4e0a44ff71e43038592791f0dd7df7 100644 (file)
@@ -963,17 +963,17 @@ float WaypointSprite_isteammate(entity e, entity e2)
     return e2 == e;
 }
 
-float WaypointSprite_Customize(entity this)
+bool WaypointSprite_Customize(entity this, entity client)
 {
     // this is not in SendEntity because it shall run every frame, not just every update
 
     // make spectators see what the player would see
-    entity e = WaypointSprite_getviewentity(other);
+    entity e = WaypointSprite_getviewentity(client);
 
-    if (MUTATOR_CALLHOOK(CustomizeWaypoint, this, other))
+    if (MUTATOR_CALLHOOK(CustomizeWaypoint, this, client))
         return false;
 
-    return this.waypointsprite_visible_for_player(this, other, e);
+    return this.waypointsprite_visible_for_player(this, client, e);
 }
 
 bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
index 7fb578f82438477dd41d19c4aa1edebb4a0978d6..fa9f4fbdf6571f0cdfbfda2187eddeeaafe0752d 100644 (file)
@@ -168,7 +168,7 @@ entity WaypointSprite_getviewentity(entity e);
 
 float WaypointSprite_isteammate(entity e, entity e2);
 
-float WaypointSprite_Customize(entity this);
+bool WaypointSprite_Customize(entity this, entity client);
 
 bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
 
index 537e04e05fd90ca8e0360d077cbb7cb227b56fa3..0ce157848e2ad6d1a411664016eb1644d99db88f 100644 (file)
@@ -130,7 +130,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
        .void(entity this) uncustomizeentityforclient;
        .float uncustomizeentityforclient_set;
 
-       void SetCustomizer(entity e, bool(entity this) customizer, void(entity this) uncustomizer)
+       void SetCustomizer(entity e, bool(entity this, entity client) customizer, void(entity this) uncustomizer)
        {
                setcefc(e, customizer);
                e.uncustomizeentityforclient = uncustomizer;
index 48357fa4083a8f47809f18cb30b39874111f9288..1eb5767fd1f421c394725404146c6e6b72cba3ee 100644 (file)
@@ -79,9 +79,11 @@ SELFWRAP(blocked, void, (), (entity this), (this))
 SELFWRAP(predraw, void, (), (entity this), (this))
 #define setpredraw(e, f) SELFWRAP_SET(predraw, e, f)
 
-SELFWRAP(customizeentityforclient, bool, (), (entity this), (this))
+#ifndef MENUQC
+SELFWRAP(customizeentityforclient, bool, (), (entity this, entity client), (this, other))
 #define setcefc(e, f) SELFWRAP_SET(customizeentityforclient, e, f)
 #define getcefc(e) SELFWRAP_GET(customizeentityforclient, e)
+#endif
 
 SELFWRAP(camera_transform, vector, (vector org, vector ang), (entity this, vector org, vector ang), (this, org, ang))
 #define setcamera_transform(e, f) SELFWRAP_SET(camera_transform, e, f)
index 1b12174b990bd4f73869ab59323169bcab30cc60..dba509b28b8d3e276aba89cac2346d196d1891b9 100644 (file)
@@ -234,7 +234,7 @@ vector findbetterlocation (vector org, float mindist)
        return org;
 }
 
-float LOD_customize(entity this)
+bool LOD_customize(entity this, entity client)
 {
        if(autocvar_loddebug)
        {
@@ -249,10 +249,10 @@ float LOD_customize(entity this)
        }
 
        // TODO csqc network this so it only gets sent once
-       vector near_point = NearestPointOnBox(this, other.origin);
-       if(vdist(near_point - other.origin, <, this.loddistance1))
+       vector near_point = NearestPointOnBox(this, client.origin);
+       if(vdist(near_point - client.origin, <, this.loddistance1))
                this.modelindex = this.lodmodelindex0;
-       else if(!this.lodmodelindex2 || vdist(near_point - other.origin, <, this.loddistance2))
+       else if(!this.lodmodelindex2 || vdist(near_point - client.origin, <, this.loddistance2))
                this.modelindex = this.lodmodelindex1;
        else
                this.modelindex = this.lodmodelindex2;
index 4f9fc471f55609698c5bb490be56fcd7a1741edb..1f5537cea52f92ffa5e7e1f3284edd20cadcea04 100644 (file)
@@ -138,7 +138,7 @@ float angc (float a1, float a2);
 .float loddistance1;
 .float loddistance2;
 
-float LOD_customize(entity this);
+bool LOD_customize(entity this, entity client);
 
 void LOD_uncustomize(entity this);
 
index e89ea8c83e3240a5674315fccb94664d94c17270..e5e7a7baf5aa2b7411485345208074fe859dffa6 100644 (file)
@@ -278,10 +278,10 @@ void ctf_CaptureShield_Update(entity player, bool wanted_status)
        }
 }
 
-bool ctf_CaptureShield_Customize(entity this)
+bool ctf_CaptureShield_Customize(entity this, entity client)
 {
-       if(!other.ctf_captureshielded) { return false; }
-       if(CTF_SAMETEAM(this, other)) { return false; }
+       if(!client.ctf_captureshielded) { return false; }
+       if(CTF_SAMETEAM(this, client)) { return false; }
 
        return true;
 }
@@ -747,11 +747,11 @@ void ctf_CheckFlagReturn(entity flag, int returntype)
        }
 }
 
-bool ctf_Stalemate_Customize(entity this)
+bool ctf_Stalemate_Customize(entity this, entity client)
 {
        // make spectators see what the player would see
        entity e, wp_owner;
-       e = WaypointSprite_getviewentity(other);
+       e = WaypointSprite_getviewentity(client);
        wp_owner = this.owner;
 
        // team waypoints
index de181307ecb4b51654d5ced8695390ded5c9de16..00cdf0d6872f54e0e17fb633f4ece9d9d4ee8820 100644 (file)
@@ -211,7 +211,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ka_EventLog("dropped", plyr);
        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
        Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
-       sound(other, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+       sound(NULL, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 
        // scoring
        // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
index 423b839eafeecd2fe73e155f24f7b7ca3092b7bc..6cb569149fb89be93781f550e3a242eb3cdfaf99 100644 (file)
@@ -494,15 +494,15 @@ void Portal_Think(entity this)
                Portal_Remove(this, 0);
 }
 
-float Portal_Customize(entity this)
+bool Portal_Customize(entity this, entity client)
 {
-       if(IS_SPEC(other))
-               other = other.enemy;
-       if(other == this.aiment)
+       if(IS_SPEC(client))
+               client = client.enemy;
+       if(client == this.aiment)
        {
                this.modelindex = this.savemodelindex;
        }
-       else if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(this.aiment))
+       else if(IS_INDEPENDENT_PLAYER(client) || IS_INDEPENDENT_PLAYER(this.aiment))
        {
                this.modelindex = 0;
        }
index 77904aca5d0912713f3e1e57402d224f7473eb38..fded1d7b478345df64353e196968e8a208646462 100644 (file)
@@ -40,10 +40,10 @@ float W_WeaponSpeedFactor(entity this)
 }
 
 
-bool CL_Weaponentity_CustomizeEntityForClient(entity this)
+bool CL_Weaponentity_CustomizeEntityForClient(entity this, entity client)
 {
        this.viewmodelforclient = this.owner;
-       if (IS_SPEC(other) && other.enemy == this.owner) this.viewmodelforclient = other;
+       if (IS_SPEC(client) && client.enemy == this.owner) this.viewmodelforclient = client;
        return true;
 }