From: Samual Lenks Date: Wed, 19 Feb 2014 05:12:41 +0000 (-0500) Subject: Cleanup, fix an issue with knowing origin X-Git-Tag: xonotic-v0.8.0~152^2~73 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0659e3a2492c4ed2ec266ca461adcf233f8631c7;p=xonotic%2Fxonotic-data.pk3dir.git Cleanup, fix an issue with knowing origin --- diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index f4e04a9c8..077a76acb 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -468,8 +468,7 @@ void Draw_ArcBeam() } setorigin(self, start_pos); - //self.beam_muzzleentity.angles = self.angles; - self.beam_muzzleentity.angles_z = random() * 360; + self.beam_muzzleentity.angles_z = random() * 360; // randomly spin the muzzleflash vector beam_endpos_estimate = (start_pos + (beamdir * self.beam_range)); @@ -487,19 +486,6 @@ void Draw_ArcBeam() vector hitorigin = start_pos; - /* - _len = vlen(self.origin - self.move_origin); - _dir = normalize(self.move_origin - self.origin); - - if(self.total_damages < time) - { - boxparticles(self.traileffect, self, self.origin, self.origin + _dir * -64, _dir * -_len , _dir * -_len, 1, PARTICLES_USEALPHA); - boxparticles(self.lip, self, self.move_origin, self.move_origin + _dir * -64, _dir * -200 , _dir * -200, 1, PARTICLES_USEALPHA); - self.total_damages = time + 0.1; - } - */ - - float i; for(i = 1; i <= segments; ++i) { @@ -627,6 +613,18 @@ void Ent_ReadArcBeam(float isnew) self.beam_range = ReadCoord(); self.beam_returnspeed = ReadShort(); self.beam_tightness = (ReadByte() / 10); + + if(ReadByte()) + { + if(autocvar_chase_active) + { self.beam_usevieworigin = 1; } + else // use view origin + { self.beam_usevieworigin = 2; } + } + else + { + self.beam_usevieworigin = 0; + } } if(sf & 2) // starting location @@ -634,24 +632,23 @@ void Ent_ReadArcBeam(float isnew) self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); - setorigin(self, self.origin); - self.beam_usevieworigin = 0; } - else // infer the location from player location + else if(self.beam_usevieworigin) // infer the location from player location { - if(autocvar_chase_active) // use player origin so that third person display still works + if(self.beam_usevieworigin == 2) { - self.beam_usevieworigin = 1; - self.origin = getplayerorigin(player_localnum) + ('0 0 1' * getstati(STAT_VIEWHEIGHT)); + // use view origin + self.origin = view_origin; } - else // use view origin + else { - self.beam_usevieworigin = 2; - self.origin = view_origin; // note that this is only necessary for the sound to be properly located + // use player origin so that third person display still works + self.origin = getplayerorigin(player_localnum) + ('0 0 1' * getstati(STAT_VIEWHEIGHT)); } - setorigin(self, self.origin); } + setorigin(self, self.origin); + if(sf & 4) // want/aim direction { self.v_angle_x = ReadCoord(); diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index f7f9adc9c..44655f71b 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -78,7 +78,8 @@ float W_Arc_Beam_Send(entity to, float sf) // - The owner client has no use for beam start position or directions, // it always figures this information out for itself with csqc code. // - Spectating the owner also truncates this information. - if((to == self.owner) || ((to.enemy == self.owner) && IS_SPEC(to))) + float drawlocal = ((to == self.owner) || ((to.enemy == self.owner) && IS_SPEC(to))); + if(drawlocal) { #if 0 sf &= ~2; @@ -97,6 +98,8 @@ float W_Arc_Beam_Send(entity to, float sf) WriteCoord(MSG_ENTITY, WEP_CVAR(arc, beam_range)); WriteShort(MSG_ENTITY, WEP_CVAR(arc, beam_returnspeed)); WriteByte(MSG_ENTITY, WEP_CVAR(arc, beam_tightness) * 10); + + WriteByte(MSG_ENTITY, drawlocal); } if(sf & 2) // starting location {