]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/vehicles/vehicle.qc
Merge branches 'TimePath/weaponsys' and 'Mario/modpack'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / vehicles / vehicle.qc
index 50f355d73ddb34f167d2f53c9c606ae5f4c17d8a..2c5fb3dd8433fb44e481b3c5a9493d7fd9df2cac 100644 (file)
@@ -164,7 +164,7 @@ void targetdrone_damage(entity inflictor, entity attacker, float damage, int dea
        self.health -= damage;
        if(self.health <= 0)
        {
-               pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
+               Send_Effect("explosion_medium", self.origin, '0 0 0', 1);
 
                if(!self.cnt)
                        remove(self);
@@ -267,8 +267,8 @@ void vehicles_locktarget(float incr, float decr, float _lock_time)
         if(trace_ent.deadflag != DEAD_NO)
             trace_ent = world;
         if(!(
-            (trace_ent.vehicle_flags & VHF_ISVEHICLE) || 
-            (trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || 
+            IS_VEHICLE(trace_ent) || 
+            IS_TURRET(trace_ent) || 
             (trace_ent.takedamage == DAMAGE_TARGETDRONE)
             )) { trace_ent = world; }
     }
@@ -434,7 +434,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound,
         sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
 
     if(_mzlfx)
-        pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
+        Send_Effect(_mzlfx, proj.origin, proj.velocity, 1);
 
 
     setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
@@ -505,7 +505,7 @@ void vehicles_spawn()
     self.angles             = self.pos2;
     setorigin(self, self.pos1 + '0 0 0');
     // Show it
-    pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+    Send_Effect("teleport", self.origin + '0 0 64', '0 0 0', 1);
 
     if(self.vehicle_controller)
         self.team = self.vehicle_controller.team;
@@ -520,7 +520,7 @@ float vehicles_crushable(entity e)
     if(IS_PLAYER(e))
         return true;
 
-    if(e.flags & FL_MONSTER)
+    if(IS_MONSTER(e))
         return true;
 
     return false;
@@ -877,7 +877,7 @@ void vehicles_painframe()
         float _ftmp;
         _ftmp = self.owner.vehicle_health / 50;
         self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
-        pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+        Send_Effect("smoke_small", (self.origin + (randomvec() * 80)), '0 0 0', 1);
 
         if(self.vehicle_flags & VHF_DMGSHAKE)
             self.velocity += randomvec() * 30;
@@ -896,19 +896,19 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, int deatht
     self.dmg_time = time;
 
        // WEAPONTODO
-    if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
+    if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id))
         damage *= autocvar_g_vehicles_vortex_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
+    if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id))
         damage *= autocvar_g_vehicles_machinegun_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
+    if(DEATH_ISWEAPON(deathtype, WEP_RIFLE.m_id))
         damage *= autocvar_g_vehicles_rifle_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
         damage *= autocvar_g_vehicles_vaporizer_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
+    if(DEATH_ISWEAPON(deathtype, WEP_SEEKER.m_id))
         damage *= autocvar_g_vehicles_tag_damagerate;
 
     self.enemy = attacker;
@@ -1003,7 +1003,7 @@ void vehicles_clearreturn()
 
 void vehicles_return()
 {
-    pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
+    Send_Effect("teleport", self.wp00.origin + '0 0 64', '0 0 0', 1);
 
     self.wp00.think     = vehicles_spawn;
     self.wp00.nextthink = time;
@@ -1359,7 +1359,7 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string
 void vehicles_gib_explode()
 {
        sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
-       pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+       Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        remove(self);
 }