]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/cl_turrets.qc
Remove .move_* fields and MOVETYPE_PUSH logic (doesn't work)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / cl_turrets.qc
index 347a5ff838ff3ee6fefb13d59d70e5e2051d72e9..7e433030879adb3fe08ff566cfe143a8a125038e 100644 (file)
@@ -2,7 +2,7 @@ void turret_remove(entity this)
 {
        remove(this.tur_head);
        //remove(this.enemy);
-       this.tur_head = world;
+       this.tur_head = NULL;
 }
 
 .vector glowmod;
@@ -34,7 +34,7 @@ void turret_draw(entity this)
        if(dt <= 0)
                return;
 
-       this.tur_head.angles += dt * this.tur_head.move_avelocity;
+       this.tur_head.angles += dt * this.tur_head.avelocity;
 
        if (this.health < 127)
        {
@@ -206,7 +206,7 @@ void turret_construct(entity this)
 {
        entity tur = get_turretinfo(this.m_id);
 
-       if(this.tur_head == world)
+       if(this.tur_head == NULL)
                this.tur_head = spawn();
 
        this.netname = tur.turret_name;
@@ -282,9 +282,9 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
 {
        entity gib;
 
-       traceline(_from, _to, MOVE_NOMONSTERS, world);
+       traceline(_from, _to, MOVE_NOMONSTERS, NULL);
        if(trace_startsolid)
-               return world;
+               return NULL;
 
        gib = new(turret_gib);
        setorigin(gib, _from);
@@ -304,10 +304,9 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
 
        gib.gravity              = 1;
        gib.move_movetype   = MOVETYPE_BOUNCE;
-       gib.move_origin  = _from;
        setorigin(gib,          _from);
-       gib.move_velocity   = _to;
-       gib.move_avelocity  = prandomvec() * 32;
+       gib.velocity   = _to;
+       gib.avelocity  = prandomvec() * 32;
        gib.move_time      = time;
        gib.damageforcescale = 1;
 
@@ -341,9 +340,9 @@ void turret_die(entity this)
                        entity headgib = turret_gibtoss((get_turretinfo(this.m_id)).head_model, this.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', true);
                        if(headgib)
                        {
-                               headgib.angles = headgib.move_angles = this.tur_head.angles;
-                               headgib.avelocity = headgib.move_avelocity = this.tur_head.move_avelocity + randomvec() * 45;
-                               headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
+                               headgib.angles = this.tur_head.angles;
+                               headgib.avelocity = this.tur_head.avelocity + randomvec() * 45;
+                               headgib.avelocity_y = headgib.avelocity_y * 5;
                                headgib.gravity = 0.5;
                        }
                }
@@ -379,22 +378,21 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
 
        if(sf & TNSF_ANG)
        {
-               if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
+               if(this.tur_head == NULL) // aparenly this can happpen before TNSF_SETUP. great.
                        this.tur_head = spawn();
 
-               this.tur_head.move_angles_x = ReadShort();
-               this.tur_head.move_angles_y = ReadShort();
-               //this.tur_head.angles = this.angles + this.tur_head.move_angles;
-               this.tur_head.angles = this.tur_head.move_angles;
+               this.tur_head.angles_x = ReadShort();
+               this.tur_head.angles_y = ReadShort();
+               //this.tur_head.angles = this.angles + this.tur_head.angles;
        }
 
        if(sf & TNSF_AVEL)
        {
-               if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
+               if(this.tur_head == NULL) // aparenly this can happpen before TNSF_SETUP. great.
                        this.tur_head = spawn();
 
-               this.tur_head.move_avelocity_x = ReadShort();
-               this.tur_head.move_avelocity_y = ReadShort();
+               this.tur_head.avelocity_x = ReadShort();
+               this.tur_head.avelocity_y = ReadShort();
        }
 
        if(sf & TNSF_MOVE)
@@ -408,11 +406,9 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
                this.velocity_y = ReadShort();
                this.velocity_z = ReadShort();
 
-               this.move_angles_y = ReadShort();
+               this.angles_y = ReadShort();
 
                this.move_time   = time;
-               this.move_velocity = this.velocity;
-               this.move_origin   = this.origin;
        }
 
        if(sf & TNSF_ANIM)