}
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));
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)
{
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
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();
// - 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;
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
{