From: Mario Date: Sun, 19 Jun 2016 17:02:26 +0000 (+1000) Subject: Purge other from customizeentityforclient X-Git-Tag: xonotic-v0.8.2~700^2~128^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a7f33b244c92e082d828e763ac1789f9b0a6c219;p=xonotic%2Fxonotic-data.pk3dir.git Purge other from customizeentityforclient --- diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 2668f7e19..dde20f26c 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -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) diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index d2a070f27..7d9c93d94 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -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; } diff --git a/qcsrc/common/minigames/sv_minigames.qc b/qcsrc/common/minigames/sv_minigames.qc index 689ce83d0..992eab054 100644 --- a/qcsrc/common/minigames/sv_minigames.qc +++ b/qcsrc/common/minigames/sv_minigames.qc @@ -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; } diff --git a/qcsrc/common/minigames/sv_minigames.qh b/qcsrc/common/minigames/sv_minigames.qh index 70c9bf805..de9e3f696 100644 --- a/qcsrc/common/minigames/sv_minigames.qh +++ b/qcsrc/common/minigames/sv_minigames.qh @@ -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); diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index c1ff98b67..de32df968 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index d9f4a396a..353baa960 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 5fdb7ec42..0cd163386 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -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); diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh index 7fb578f82..fa9f4fbdf 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh @@ -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); diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index 537e04e05..0ce157848 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -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; diff --git a/qcsrc/lib/self.qh b/qcsrc/lib/self.qh index 48357fa40..1eb5767fd 100644 --- a/qcsrc/lib/self.qh +++ b/qcsrc/lib/self.qh @@ -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) diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 1b12174b9..dba509b28 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -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; diff --git a/qcsrc/server/g_subs.qh b/qcsrc/server/g_subs.qh index 4f9fc471f..1f5537cea 100644 --- a/qcsrc/server/g_subs.qh +++ b/qcsrc/server/g_subs.qh @@ -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); diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index e89ea8c83..e5e7a7baf 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -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 diff --git a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc index de181307e..00cdf0d68 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc @@ -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. diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 423b839ea..6cb569149 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -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; } diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 77904aca5..fded1d7b4 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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; }