From: MirceaKitsune Date: Wed, 13 Jul 2011 15:24:23 +0000 (+0300) Subject: Apply the chase_active cvar of the spectatee, not of the player that's spectated... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c06fb23d425e6527460358d14dc10660c90dfbb9;p=voretournament%2Fvoretournament.git Apply the chase_active cvar of the spectatee, not of the player that's spectated. This fixes players seeing enemies as floating stomachs if spectating prey with chase_active enabled --- diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index eb74e49d..2503070e 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -523,11 +523,14 @@ float Client_customizeentityforclient() // this is only visible to the prey however, otherwise players would appear as a floating stomach to everyone (ewww) stomachmodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_stomach.md3"); // 4 is the extension length + float chase; + chase = other.cvar_chase_active; + if(other.spectatee_status && other.spectatee_status == num_for_edict(other.enemy)) other = other.enemy; // also do this for the player we are spectating // don't do this if we have chase_active enabled, as we'd be seeing a floating stomach from third person view - if not(other.cvar_chase_active || other.classname == "observer") // the observer check prevents a bug + if not(chase || other.classname == "observer") // the observer check prevents a bug if(other.predator == self || other.fakepredator == self) { Client_setmodel(stomachmodel); @@ -540,7 +543,7 @@ float Client_customizeentityforclient() self.effects &~= EF_NODEPTHTEST; if not(self.stat_eaten || self.fakeprey) self.alpha = default_player_alpha; - else if(cvar("g_vore_neighborprey_distance") && !self.fakeprey && (self.predator == other.predator || self.predator == other.fakepredator) && !(other.cvar_chase_active || other.classname == "observer")) + else if(cvar("g_vore_neighborprey_distance") && !self.fakeprey && (self.predator == other.predator || self.predator == other.fakepredator) && !(chase || other.classname == "observer")) { self.alpha = default_player_alpha; // allow seeing neighboring prey self.effects |= EF_NODEPTHTEST; // don't hide behind the stomach's own EF_NODEPTHTEST diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index eed6d74c..4a8ceaff 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -256,10 +256,13 @@ float CL_ExteriorWeaponentity_CustomizeEntityForClient() if(self.owner.weaponname == "" || self.owner.deadflag != DEAD_NO) return TRUE; + float chase; + chase = other.cvar_chase_active; + if(other.spectatee_status && other.spectatee_status == num_for_edict(other.enemy)) other = other.enemy; // also do this for the player we are spectating - if not(other.cvar_chase_active || other.classname == "observer") // the observer check prevents a bug + if not(chase || other.classname == "observer") // the observer check prevents a bug if(other.predator == self.owner || other.fakepredator == self.owner) { setmodel(self, ""); @@ -269,7 +272,7 @@ float CL_ExteriorWeaponentity_CustomizeEntityForClient() self.effects &~= EF_NODEPTHTEST; if not(self.owner.stat_eaten) setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); - else if(cvar("g_vore_neighborprey_distance") && (other.predator == self.owner.predator || other.fakepredator == self.owner.predator) && !(other.cvar_chase_active || other.classname == "observer")) + else if(cvar("g_vore_neighborprey_distance") && (other.predator == self.owner.predator || other.fakepredator == self.owner.predator) && !(chase || other.classname == "observer")) { setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); // allow seeing neighboring prey's weapon model self.effects |= EF_NODEPTHTEST; // don't hide behind the stomach's own EF_NODEPTHTEST