]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use set_movetype everywhere
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 6 Aug 2016 05:47:09 +0000 (15:47 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 6 Aug 2016 05:50:26 +0000 (15:50 +1000)
22 files changed:
qcsrc/client/weapons/projectile.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
qcsrc/common/mutators/mutator/nades/net.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/player.qh
qcsrc/common/t_items.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/ewheel.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/ecs/systems/physics.qc
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/sv_main.qc

index 4015828e555fc6a41db87329254197072e3d9d58..6d58ac77a2d1a01f72688513ecc2708750d93622 100644 (file)
@@ -19,7 +19,7 @@
 void SUB_Stop(entity this, entity toucher)
 {
        this.velocity = this.avelocity = '0 0 0';
-       this.move_movetype = MOVETYPE_NONE;
+       set_movetype(this, MOVETYPE_NONE);
 }
 
 void Projectile_ResetTrail(entity this, vector to)
@@ -330,7 +330,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                this.maxs = '0 0 0';
                this.colormod = '0 0 0';
                settouch(this, SUB_Stop);
-               this.move_movetype = MOVETYPE_TOSS;
+               set_movetype(this, MOVETYPE_TOSS);
                this.alphamod = 1;
 
                switch (this.cnt)
@@ -340,7 +340,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                loopsound(this, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM);
                                this.mins = '-4 -4 -4';
                                this.maxs = '4 4 4';
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                this.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor);
                                this.bouncestop = WEP_CVAR_SEC(electro, bouncestop);
@@ -358,7 +358,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                        case PROJECTILE_GRENADE_BOUNCING:
                                this.mins = '-3 -3 -3';
                                this.maxs = '3 3 3';
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                this.bouncefactor = WEP_CVAR(mortar, bouncefactor);
                                this.bouncestop = WEP_CVAR(mortar, bouncestop);
@@ -376,21 +376,21 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                        case PROJECTILE_PORTO_RED:
                                this.colormod = '2 1 1';
                                this.alphamod = 0.5;
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                break;
                        case PROJECTILE_PORTO_BLUE:
                                this.colormod = '1 1 2';
                                this.alphamod = 0.5;
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                break;
                        case PROJECTILE_HAGAR_BOUNCING:
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                break;
                        case PROJECTILE_CRYLINK_BOUNCING:
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                break;
                        case PROJECTILE_FIREBALL:
@@ -400,7 +400,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                break;
                        case PROJECTILE_FIREMINE:
                                loopsound(this, CH_SHOTS_SINGLE, SND(FIREBALL_FLY), VOL_BASE, ATTEN_NORM);
-                               this.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(this, MOVETYPE_BOUNCE);
                                settouch(this, func_null);
                                this.mins = '-4 -4 -4';
                                this.maxs = '4 4 4';
@@ -460,16 +460,16 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
        if (this.gravity)
        {
                if (this.move_movetype == MOVETYPE_FLY)
-                       this.move_movetype = MOVETYPE_TOSS;
+                       set_movetype(this, MOVETYPE_TOSS);
                if (this.move_movetype == MOVETYPE_BOUNCEMISSILE)
-                       this.move_movetype = MOVETYPE_BOUNCE;
+                       set_movetype(this, MOVETYPE_BOUNCE);
        }
        else
        {
                if (this.move_movetype == MOVETYPE_TOSS)
-                       this.move_movetype = MOVETYPE_FLY;
+                       set_movetype(this, MOVETYPE_FLY);
                if (this.move_movetype == MOVETYPE_BOUNCE)
-                       this.move_movetype = MOVETYPE_BOUNCEMISSILE;
+                       set_movetype(this, MOVETYPE_BOUNCEMISSILE);
        }
 
        if (!(this.count & 0x80))
index a4ade38366e709e8a14e90d086fb60258c4ceeca..47f2df9a9421fa99f4bab467067996985783db06 100644 (file)
@@ -154,7 +154,7 @@ NET_HANDLE(casings, bool isNew)
     if (isNew) IL_PUSH(g_drawables, casing);
     casing.velocity = casing.velocity + 2 * prandomvec();
     casing.avelocity = '0 250 0' + 100 * prandomvec();
-    casing.move_movetype = MOVETYPE_BOUNCE;
+    set_movetype(casing, MOVETYPE_BOUNCE);
     settouch(casing, Casing_Touch);
     casing.move_time = time;
     casing.event_damage = Casing_Damage;
index 78f1a27cc6c0a0eba824fa7899e1a099d117b3e3..267b3f319e2182a96cafc99af764eff68f734da1 100644 (file)
@@ -170,7 +170,7 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector
 
        // TODO remove some gibs according to cl_nogibs
        gib = RubbleNew("gib");
-       gib.move_movetype = MOVETYPE_BOUNCE;
+       set_movetype(gib, MOVETYPE_BOUNCE);
        gib.gravity = 1;
        gib.solid = SOLID_CORPSE;
        gib.cnt = specnum;
index 013479242bb1b0a5a69857f635ed8b324b09f83f..fb8cb71719a2e4acea5a10718a737eb4f54d50bb 100644 (file)
@@ -117,15 +117,15 @@ void cpicon_construct(entity this)
                setmodel(this.icon_realmodel, MDL_Null);
                setorigin(this.icon_realmodel, this.origin);
                setsize(this.icon_realmodel, CPICON_MIN, CPICON_MAX);
-               this.icon_realmodel.move_movetype = MOVETYPE_NOCLIP;
+               set_movetype(this.icon_realmodel, MOVETYPE_NOCLIP);
                this.icon_realmodel.solid = SOLID_NOT;
        }
 
        if(this.iscaptured) { this.icon_realmodel.solid = SOLID_BBOX; }
 
-       this.move_movetype      = MOVETYPE_NOCLIP;
+       set_movetype(this, MOVETYPE_NOCLIP);
        this.solid                      = SOLID_NOT;
-       this.move_movetype              = MOVETYPE_NOCLIP;
+       set_movetype(this, MOVETYPE_NOCLIP);
        this.move_time          = time;
        this.drawmask           = MASK_NORMAL;
        this.alpha                      = 1;
index 0135f467ed0eb5fb84e9180048ce2df87bb67077..9de2ade729bfed824996e5fb0adf03610f8eaefc 100644 (file)
@@ -33,7 +33,7 @@ void ons_generator_ray_spawn(vector org)
        setmodel(e, MDL_ONS_RAY);
        setorigin(e, org);
        e.angles = randomvec() * 360;
-       e.move_movetype = MOVETYPE_NONE;
+       set_movetype(e, MOVETYPE_NONE);
        e.alpha = 0;
        e.scale = random() * 5 + 8;
        e.move_time = time + 0.05;
@@ -152,9 +152,9 @@ void generator_construct(entity this)
        setmodel(this, MDL_ONS_GEN);
        setsize(this, GENERATOR_MIN, GENERATOR_MAX);
 
-       this.move_movetype      = MOVETYPE_NOCLIP;
+       set_movetype(this, MOVETYPE_NOCLIP);
        this.solid                      = SOLID_BBOX;
-       this.move_movetype              = MOVETYPE_NOCLIP;
+       set_movetype(this, MOVETYPE_NOCLIP);
        this.move_time          = time;
        this.drawmask           = MASK_NORMAL;
        this.alpha                      = 1;
index 9488e02a527a098620f9848cd971e412a205f92e..e2659c7af85307fb2e30529e1318b83e35a12746 100644 (file)
@@ -31,7 +31,7 @@ void orb_setup(entity e)
        e.draw = orb_draw;
        IL_PUSH(g_drawables, e);
        e.health = 255;
-       e.move_movetype = MOVETYPE_NONE;
+       set_movetype(e, MOVETYPE_NONE);
        e.solid = SOLID_NOT;
        e.drawmask = MASK_NORMAL;
        e.scale = 0.01;
index 090144dd16069f16573489d72f8a8cae53c7cdb0..0b27f727a5ac6eb5e81ed95105a802bb0d17b2d5 100644 (file)
 #ifdef SVQC
 void set_movetype(entity this, int mt)
 {
-       if(mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH)
-       {
-               this.movetype = this.move_movetype = mt; // we still set move_movetype, for other code that checks movetype
+       this.move_movetype = mt;
+       if (mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH) {
                this.move_qcphysics = false;
-               return;
        }
-
-       this.move_movetype = mt;
-
-       if(!this.move_qcphysics)
+       if (!this.move_qcphysics) {
                this.movetype = mt;
+       }
 }
 #elif defined(CSQC)
 void set_movetype(entity this, int mt)
index aac32181318a2f24928b9cb88651af3e2031c33b..f120e9fe6cff8ebe5866250663aa8c9f314d6dff 100644 (file)
@@ -168,7 +168,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK)
 #ifdef CSQC
 
        #define PHYS_FIXANGLE(s) ('0 0 0')
-       #define PHYS_MOVETYPE(s) ((s).move_movetype)
 
        string autocvar_cl_jumpspeedcap_min;
        string autocvar_cl_jumpspeedcap_max;
@@ -245,7 +244,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK)
 #elif defined(SVQC)
 
        #define PHYS_FIXANGLE(s) ((s).fixangle)
-       #define PHYS_MOVETYPE(s) ((s).move_movetype)
 
        bool Physics_Valid(string thecvar);
 
index 8563349fd920f74e725c66bd4cd9609ae8142fa3..997a9d78ea7e3bcb7092e19f90744eb89579b2f4 100644 (file)
@@ -194,7 +194,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
     if(sf & ISF_MODEL)
     {
         this.drawmask  = MASK_NORMAL;
-               this.move_movetype = MOVETYPE_TOSS;
+               set_movetype(this, MOVETYPE_TOSS);
                if (isnew) IL_PUSH(g_drawables, this);
         this.draw       = ItemDraw;
         this.solid = SOLID_TRIGGER;
@@ -254,7 +254,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
         this.gravity = 1;
         this.pushable = true;
         //this.angles = '0 0 0';
-        this.move_movetype = MOVETYPE_TOSS;
+        set_movetype(this, MOVETYPE_TOSS);
         this.velocity_x = ReadCoord();
         this.velocity_y = ReadCoord();
         this.velocity_z = ReadCoord();
index 8bd6016f28a5498f33cb0a0c544fbeca29a93d3d..73ceb639408ea20361504d6489d80fc569223a12 100644 (file)
@@ -154,7 +154,7 @@ void conveyor_init(entity this)
        IL_PUSH(g_drawables, this);
        this.drawmask = MASK_NORMAL;
 
-       this.move_movetype = MOVETYPE_NONE;
+       set_movetype(this, MOVETYPE_NONE);
        this.model = "";
        this.solid = SOLID_TRIGGER;
        this.move_time = time;
index a0fb12a4c4806c10140a7f32645e75f6b190ae70..f89f67d7f396cacd2877de25c36948a866ca0ed3 100644 (file)
@@ -815,7 +815,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                this.SUB_LTIME = ReadCoord();
 
                this.solid = SOLID_BSP;
-               this.move_movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
                this.use = door_use;
 
                LinkDoors(this);
@@ -824,7 +824,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                        door_init_startopen(this);
 
                this.move_time = time;
-               this.move_movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
        }
 
        if(sf & SF_TRIGGER_RESET)
index 341ca460feb28eef5bcf954e59b3f9aee7c18c30..396636e8cd214cf8c96e8f7f95b0ae90a920e192 100644 (file)
@@ -168,7 +168,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
 
                this.classname = "plat";
                this.solid = SOLID_BSP;
-               this.move_movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
                this.drawmask = MASK_NORMAL;
                this.draw = plat_draw;
                if (isnew) IL_PUSH(g_drawables, this);
@@ -177,7 +177,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
 
                plat_reset(this); // also called here
 
-               this.move_movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
                this.move_time = time;
 
                plat_spawn_inside_trigger(this);
index 29c7d0a7b125898ae519ced47c7bd42fc1ac850f..247bfb0fc1e5e34703fc23f42e751e0d57be681a 100644 (file)
@@ -307,7 +307,7 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew)
 
                this.classname = "func_train";
                this.solid = SOLID_BSP;
-               this.move_movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
                this.drawmask = MASK_NORMAL;
                this.draw = train_draw;
                if (isnew) IL_PUSH(g_drawables, this);
@@ -325,7 +325,7 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew)
                // but we will need these
                train_next(this);
 
-               this.move_movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
                this.move_time = time;
        }
 
index 5ec7b41fd484c84fe3cbbe8ce7f32452038c8d9e..effeff95675702af70cc75a99f37f045bc74a7c2 100644 (file)
@@ -174,11 +174,11 @@ void trigger_push_touch(entity this, entity toucher)
                switch(toucher.move_movetype)
                {
                        case MOVETYPE_FLY:
-                               toucher.move_movetype = MOVETYPE_TOSS;
+                               set_movetype(toucher, MOVETYPE_TOSS);
                                toucher.gravity = 1;
                                break;
                        case MOVETYPE_BOUNCEMISSILE:
-                               toucher.move_movetype = MOVETYPE_BOUNCE;
+                               set_movetype(toucher, MOVETYPE_BOUNCE);
                                toucher.gravity = 1;
                                break;
                }
index 71181f209eeed787652d166d2a9e0e1e345a425c..cc2ef8c4de143a4cfdd6efe21c2a8e8b2a8a647e 100644 (file)
@@ -1349,7 +1349,7 @@ bool turret_initialize(entity this, Turret tur)
        this.tur_head.owner                     = this;
        this.tur_head.takedamage        = DAMAGE_NO;
        this.tur_head.solid                     = SOLID_NOT;
-       this.tur_head.move_movetype             = this.move_movetype;
+       set_movetype(this.tur_head, this.move_movetype);
 
        if(!this.tur_defend)
        if(this.target != "")
index 62d7222ce496003b284e43342d766159a08f3ab1..2a6245cd0d8a3bb0cf9699d17c49bbadf4c0856c 100644 (file)
@@ -257,7 +257,7 @@ void ewheel_draw(entity this)
         METHOD(EWheel, tr_setup, void(EWheel this, entity it))
         {
             it.gravity         = 1;
-            it.move_movetype = MOVETYPE_BOUNCE;
+            set_movetype(it, MOVETYPE_BOUNCE);
             it.move_time               = time;
             it.draw                    = ewheel_draw;
         }
index 3f55280e8fa372cf790d726b29eb41bde633e703..14e9a28d568b86580139610b39ed03e01ab37553 100644 (file)
@@ -652,7 +652,7 @@ void walker_draw(entity this)
         METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
         {
             it.gravity         = 1;
-            it.move_movetype   = MOVETYPE_BOUNCE;
+            set_movetype(it, MOVETYPE_BOUNCE);
             it.move_time               = time;
             it.draw                    = walker_draw;
         }
index 277326ffd2a18e055ab6c2b3ff8258356c23639a..0d6217774e9bd9384f0b8a0a09b9c5dd05dd6889 100644 (file)
@@ -545,7 +545,7 @@ METHOD(Racer, vr_enter, void(Racer thisveh, entity instance))
     if(instance.owner.flagcarried)
        setorigin(instance.owner.flagcarried, '-190 0 96');
 #elif defined(CSQC)
-    instance.move_movetype = MOVETYPE_BOUNCE;
+    set_movetype(instance, MOVETYPE_BOUNCE);
 #endif
 }
 
index 8646b29cc983827a48be0387de3373d8f3295bf9..f5052b376f89f4072ca33ef968b3e4bba3d66f56 100644 (file)
@@ -26,7 +26,7 @@ void sys_phys_update(entity this, float dt)
        sys_phys_pregame_hold(this);
 
        if (IS_SVQC) {
-               if (PHYS_MOVETYPE(this) == MOVETYPE_NONE) { return; }
+               if (this.move_movetype == MOVETYPE_NONE) { return; }
                // when we get here, disableclientprediction cannot be 2
                this.disableclientprediction = (this.move_qcphysics) ? -1 : 0;
        }
@@ -86,9 +86,9 @@ void sys_phys_update(entity this, float dt)
                }
        } else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod)) {
                // handled
-       } else if (PHYS_MOVETYPE(this) == MOVETYPE_NOCLIP
-           || PHYS_MOVETYPE(this) == MOVETYPE_FLY
-           || PHYS_MOVETYPE(this) == MOVETYPE_FLY_WORLDONLY
+       } else if (this.move_movetype == MOVETYPE_NOCLIP
+           || this.move_movetype == MOVETYPE_FLY
+           || this.move_movetype == MOVETYPE_FLY_WORLDONLY
            || MUTATOR_CALLHOOK(IsFlying, this)) {
                this.com_phys_friction = PHYS_FRICTION(this);
                this.com_phys_vel_max = PHYS_MAXSPEED(this) * maxspeed_mod;
index fe307fc01ac5872538b0ffd5aada4cdd964cab24..da388a1cad21b41f620dda4023c778640a7bf513 100644 (file)
@@ -2428,7 +2428,7 @@ void DrownPlayer(entity this)
 
 void Player_Physics(entity this)
 {
-       this.movetype = ((this.move_qcphysics) ? MOVETYPE_NONE : this.move_movetype);
+       set_movetype(this, ((this.move_qcphysics) ? MOVETYPE_NONE : this.move_movetype));
 
        if(!this.move_qcphysics)
                return;
@@ -2438,7 +2438,7 @@ void Player_Physics(entity this)
        if(mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH || mt == MOVETYPE_PHYSICS)
        {
                this.move_qcphysics = false;
-               this.movetype = mt;
+               set_movetype(this, mt);
                return;
        }
 
index 7d477ac577daf27f5074f1b4194766172b6512b3..fe3c4d1d1ccdf08fce576b57e378edb42c72e006 100644 (file)
@@ -1993,7 +1993,7 @@ void Physics_Frame()
 
        FOREACH_ENTITY_FLOAT(pure_data, false,
        {
-               if(IS_CLIENT(it) || it.classname == "" || it.movetype == MOVETYPE_PUSH || it.movetype == MOVETYPE_FAKEPUSH || it.movetype == MOVETYPE_PHYSICS)
+               if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS)
                        continue;
 
                int mt = it.move_movetype;
@@ -2001,11 +2001,11 @@ void Physics_Frame()
                if(mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH || mt == MOVETYPE_PHYSICS)
                {
                        it.move_qcphysics = false;
-                       it.movetype = mt;
+                       set_movetype(it, mt);
                        continue;
                }
 
-               it.movetype = ((it.move_qcphysics) ? MOVETYPE_NONE : it.move_movetype);
+               set_movetype(it, ((it.move_qcphysics) ? MOVETYPE_NONE : it.move_movetype));
 
                if(it.move_movetype == MOVETYPE_NONE)
                        continue;
index a10edf45b4173a8a01df3b1632aa0578430ca027..b896f183efe9c819129a64b1e102882290514076 100644 (file)
@@ -369,7 +369,7 @@ LABEL(cvar_fail)
                return;
        }
 
-       this.move_movetype = this.movetype;
+       set_movetype(this, this.movetype);
 
        // support special -1 and -2 angle from radiant
        if (this.angles == '0 -1 0')