]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/sv_vehicles.qc
Clean up vehicle physics plugin a bit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / sv_vehicles.qc
index bbc128531834c4a7b2db3d3993e4d3bb5ce6e155..7e5bc93eb87abfdf7bff47b8404dd652cee62338 100644 (file)
@@ -232,12 +232,12 @@ void vehicles_projectile_explode()
        remove (self);
 }
 
-entity vehicles_projectile(string _mzlfx, Sound _mzlsound,
+entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
                                                   vector _org, vector _vel,
                                                   float _dmg, float _radi, float _force,  float _size,
                                                   int _deahtype, float _projtype, float _health,
                                                   bool _cull, bool _clianim, entity _owner)
-{SELFPARAM();
+{
     TC(Sound, _mzlsound);
        entity proj;
 
@@ -258,7 +258,7 @@ entity vehicles_projectile(string _mzlfx, Sound _mzlsound,
        proj.velocity            = _vel;
        proj.touch                      = vehicles_projectile_explode;
        proj.use                          = vehicles_projectile_explode;
-       proj.owner                      = self;
+       proj.owner                      = this;
        proj.realowner          = _owner;
        proj.think                      = SUB_Remove_self;
        proj.nextthink          = time + 30;
@@ -273,7 +273,7 @@ entity vehicles_projectile(string _mzlfx, Sound _mzlsound,
                proj.flags                 = FL_PROJECTILE | FL_NOTARGET;
 
        if(_mzlsound != SND_Null)
-               sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
+               sound (this, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
 
        if(_mzlfx)
                Send_Effect_(_mzlfx, proj.origin, proj.velocity, 1);
@@ -338,7 +338,7 @@ bool vehicle_addplayerslot( entity _owner,
                                                                entity _slot,
                                                                int _hud,
                                                                string _hud_model,
-                                                               bool() _framefunc,
+                                                               bool(entity) _framefunc,
                                                                void(bool) _exitfunc, float() _enterfunc)
 {
        if(!(_owner.vehicle_flags & VHF_MULTISLOT))
@@ -578,18 +578,18 @@ void vehicle_use()
        }
 }
 
-void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
-{SELFPARAM();
-       if(self.(regen_field) < field_max)
+void vehicles_regen(entity this, float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
+{
+       if(this.(regen_field) < field_max)
        if(timer + rpause < time)
        {
                if(_healthscale)
-                       regen = regen * (self.vehicle_health / self.max_health);
+                       regen = regen * (this.vehicle_health / this.max_health);
 
-               self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max);
+               this.(regen_field) = min(this.(regen_field) + regen * delta_time, field_max);
 
-               if(self.owner)
-                       self.owner.(regen_field) = (self.(regen_field) / field_max) * 100;
+               if(this.owner)
+                       this.owner.(regen_field) = (this.(regen_field) / field_max) * 100;
        }
 }