]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
Merge branch 'master' into terencehill/menu_optimization
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / bumblebee_weapons.qc
index 79252e13cbb2401c5557d405625e16f8bf2c2381..11ee8ebc7eed104bcc529b5b09e89794cf936f9c 100644 (file)
@@ -7,6 +7,8 @@
 
 #ifdef IMPLEMENTATION
 
+REGISTER_NET_LINKED(ENT_CLIENT_BUMBLE_RAYGUN)
+
 #ifdef SVQC
 
 float autocvar_g_vehicle_bumblebee_cannon_cost;
@@ -25,17 +27,17 @@ void bumblebee_fire_cannon(entity _gun, string _tagname, entity _owner)
     vehicles_projectile(EFFECT_BIGPLASMA_MUZZLEFLASH.eent_eff_name, SND(VEH_BUMBLEBEE_FIRE),
                         v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
                         autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force,  0,
-                        DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
+                        DEATH_VH_BUMB_GUN.m_id, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
 }
 
 bool bumble_raygun_send(entity this, entity to, float sf)
 {
-    WriteByte(MSG_ENTITY, ENT_CLIENT_BUMBLE_RAYGUN);
+    WriteHeader(MSG_ENTITY, ENT_CLIENT_BUMBLE_RAYGUN);
 
     WriteByte(MSG_ENTITY, sf);
     if(sf & BRG_SETUP)
     {
-        WriteByte(MSG_ENTITY, num_for_edict(self.realowner));
+        WriteByte(MSG_ENTITY, etof(self.realowner));
         WriteByte(MSG_ENTITY, self.realowner.team);
         WriteByte(MSG_ENTITY, self.cnt);
     }
@@ -63,8 +65,8 @@ bool bumble_raygun_send(entity this, entity to, float sf)
 
 void bumble_raygun_draw(entity this);
 
-void bumble_raygun_read(bool bIsNew)
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_BUMBLE_RAYGUN, bool isnew)
+{
     int sf = ReadByte();
 
     if(sf & BRG_SETUP)
@@ -99,8 +101,10 @@ void bumble_raygun_read(bool bIsNew)
         self.move_origin_y = ReadCoord();
         self.move_origin_z = ReadCoord();
     }
+    return true;
 }
 
+.float bumble_raygun_nextdraw;
 void bumble_raygun_draw(entity this)
 {
     float _len;
@@ -110,11 +114,11 @@ void bumble_raygun_draw(entity this)
     _len = vlen(self.origin - self.move_origin);
     _dir = normalize(self.move_origin - self.origin);
 
-    if(self.total_damages < time)
+    if(self.bumble_raygun_nextdraw < time)
     {
-        boxparticles(particleeffectnum(Effects[self.traileffect]), self, self.origin, self.origin + _dir * -64, _dir * -_len , _dir * -_len, 1, PARTICLES_USEALPHA);
+        boxparticles(particleeffectnum(Effects_from(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;
+        self.bumble_raygun_nextdraw = time + 0.1;
     }
 
     float i, df, sz, al;