]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix warpzones
authorMario <mario@smbclan.net>
Fri, 22 Jul 2016 17:01:46 +0000 (03:01 +1000)
committerMario <mario@smbclan.net>
Fri, 22 Jul 2016 17:01:46 +0000 (03:01 +1000)
13 files changed:
qcsrc/client/weapons/projectile.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/step.qc
qcsrc/common/physics/movetypes/toss.qc
qcsrc/common/physics/movetypes/walk.qc
qcsrc/common/t_items.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/subs.qh
qcsrc/common/triggers/teleporters.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/lib/warpzone/server.qc

index 973005e1256c0fb3de543f275c7a9aa30c6450b2..56a172b10b193ae2a326b5c722d5f161091bbb92 100644 (file)
@@ -62,7 +62,7 @@ void Projectile_Draw(entity this)
 
        if (this.count & 0x80)
        {
-               // this.flags &= ~FL_ONGROUND;
+               // UNSET_ONGROUND(this);
                if (this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FLY)
                        Movetype_Physics_NoMatchServer(this);
                // the trivial movetypes do not have to match the
@@ -72,7 +72,7 @@ void Projectile_Draw(entity this)
                // moving, we might still be ticrate dependent.
                else
                        Movetype_Physics_MatchServer(this, autocvar_cl_projectiles_sloppy);
-               if (!(this.flags & FL_ONGROUND))
+               if (!IS_ONGROUND(this))
                        if (this.velocity != '0 0 0')
                                this.angles = vectoangles(this.velocity);
        }
@@ -209,9 +209,9 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
        // projectiles no longer being able to lie on a bmodel
        this.move_nomonsters = MOVE_WORLDONLY;
        if (f & 0x40)
-               this.flags |= FL_ONGROUND;
+               SET_ONGROUND(this);
        else
-               this.flags &= ~FL_ONGROUND;
+               UNSET_ONGROUND(this);
 
        if (!this.move_time)
        {
index 9eae4205156fa89b4856e9f7f2d2a1b7d776602c..4ef7b51bc48c3876291a6d7f59c53604ffd91481 100644 (file)
@@ -49,7 +49,7 @@ void Casing_Delete(entity this)
 
 void Casing_Draw(entity this)
 {
-    if (this.flags & FL_ONGROUND)
+    if (IS_ONGROUND(this))
     {
         this.angles_x = 0;
         this.angles_z = 0;
@@ -122,7 +122,7 @@ void Casing_Damage(entity this, float thisdmg, int hittype, vector org, vector t
     if (thisforce.z < 0)
         thisforce.z = 0;
     this.velocity = this.velocity + thisforce + '0 0 100';
-    this.flags &= ~FL_ONGROUND;
+    UNSET_ONGROUND(this);
 }
 
 NET_HANDLE(casings, bool isNew)
index 09ec8868f430c2a58c62e0198fd2d64784f7be87..b53b605058a1fc340322ca225dcd33b500a044bc 100644 (file)
@@ -256,7 +256,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                        if(vdist(thisforce, !=, 0))
                        {
                                it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, autocvar_g_balance_damagepush_speedfactor);
-                               it.flags &= ~FL_ONGROUND;
+                               UNSET_ONGROUND(it);
                        }
 
                if(w_issilent)
index f00128da4d2b2254edf401c883f37f549cdf3abb..03a25ab0bcba621c7dc3eb4735da851488a1a51e 100644 (file)
@@ -46,7 +46,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                this.move_didgravity = 1;
                grav = dt * (PHYS_ENTGRAVITY(this) ? PHYS_ENTGRAVITY(this) : 1) * PHYS_GRAVITY(this);
 
-               if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !(this.flags & FL_ONGROUND))
+               if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !IS_ONGROUND(this))
                {
                        if(GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE)
                                this.velocity_z -= grav * 0.5;
@@ -99,7 +99,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                                        trace_ent = NULL;
                                }
 
-                               this.flags |= FL_ONGROUND;
+                               SET_ONGROUND(this);
                                this.move_groundentity = trace_ent;
                        }
                }
@@ -230,7 +230,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
 
        if(applygravity)
        {
-               if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !(this.flags & FL_ONGROUND))
+               if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !IS_ONGROUND(this))
                {
                        if(GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE)
                                this.velocity_z -= grav * 0.5f;
@@ -480,7 +480,7 @@ float _Movetype_PushEntity(entity this, vector push, bool failonstartsolid)  //
        this.origin = trace_endpos;
 
        if(trace_fraction < 1)
-               if(this.solid >= SOLID_TRIGGER && (!(this.flags & FL_ONGROUND) || (this.move_groundentity != trace_ent)))
+               if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.move_groundentity != trace_ent)))
                        _Movetype_Impact(this, trace_ent);
 
        return trace_fraction;
@@ -655,7 +655,7 @@ void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)  // SV_Ph
        this.move_time += n * tr;
 
        if(!this.move_didgravity)
-               this.move_didgravity = ((this.move_movetype == MOVETYPE_BOUNCE || this.move_movetype == MOVETYPE_TOSS) && !(this.flags & FL_ONGROUND));
+               this.move_didgravity = ((this.move_movetype == MOVETYPE_BOUNCE || this.move_movetype == MOVETYPE_TOSS) && !IS_ONGROUND(this));
 
        for (int i = 0; i < n; ++i)
        {
@@ -665,7 +665,7 @@ void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)  // SV_Ph
        }
 
 
-       if(dt > 0 && this.move_movetype != MOVETYPE_NONE && !(this.flags & FL_ONGROUND))
+       if(dt > 0 && this.move_movetype != MOVETYPE_NONE && !IS_ONGROUND(this))
        {
                // now continue the move from move_time to time
 
index 4480bb30d467ea546e29bcda82e7fbb4087ef7ec..7eb553bfaa983cbffc9eb28e352a5a7f2e3ced52 100644 (file)
@@ -1,10 +1,10 @@
 void _Movetype_Physics_Step(entity this, float dt) // SV_Physics_Step
 {
-       if(this.flags & FL_ONGROUND)
+       if(IS_ONGROUND(this))
        {
                if(this.velocity_z >= (1.0 / 32.0) && UPWARD_VELOCITY_CLEARS_ONGROUND(this))
                {
-                       this.flags &= ~FL_ONGROUND;
+                       UNSET_ONGROUND(this);
                        _Movetype_CheckVelocity(this);
                        _Movetype_FlyMove(this, dt, true, '0 0 0', 0);
                        _Movetype_LinkEdict(this, true);
index 7b8f863a5f775cbc8b6cde185d510b6c37a01757..db3ff72daa84551704c9930ed0955e9f9a03e13d 100644 (file)
@@ -2,11 +2,11 @@
 
 void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
 {
-       if (this.flags & FL_ONGROUND)
+       if (IS_ONGROUND(this))
        {
                if (this.velocity.z >= 1 / 32 && UPWARD_VELOCITY_CLEARS_ONGROUND(this))
                {
-                       this.flags &= ~FL_ONGROUND;
+                       UNSET_ONGROUND(this);
                }
                else if (!this.move_groundentity)
                {
@@ -64,7 +64,7 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
                if (this.move_movetype == MOVETYPE_BOUNCEMISSILE)
                {
                        this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 2.0);
-                       this.flags &= ~FL_ONGROUND;
+                       UNSET_ONGROUND(this);
                }
                else if (this.move_movetype == MOVETYPE_BOUNCE)
                {
@@ -77,14 +77,14 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
                        float d = trace_plane_normal * this.velocity;
                        if (trace_plane_normal.z > 0.7 && d < bstop && d > -bstop)
                        {
-                               this.flags |= FL_ONGROUND;
+                               SET_ONGROUND(this);
                                this.move_groundentity = trace_ent;
                                this.velocity = '0 0 0';
                                this.avelocity = '0 0 0';
                        }
                        else
                        {
-                               this.flags &= ~FL_ONGROUND;
+                               UNSET_ONGROUND(this);
                        }
                }
                else
@@ -92,7 +92,7 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
                        this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 1.0);
                        if (trace_plane_normal.z > 0.7)
                        {
-                               this.flags |= FL_ONGROUND;
+                               SET_ONGROUND(this);
                                this.move_groundentity = trace_ent;
                                if (trace_ent.solid == SOLID_BSP)
                                        this.move_suspendedinair = true;
@@ -101,7 +101,7 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
                        }
                        else
                        {
-                               this.flags &= ~FL_ONGROUND;
+                               UNSET_ONGROUND(this);
                        }
                }
 
@@ -110,11 +110,11 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
                        break;
 
                // DP revision 8918 (WHY...)
-               if (this.flags & FL_ONGROUND)
+               if (IS_ONGROUND(this))
                        break;
        }
 
-       //if (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE && this.move_didgravity > 0 && !(this.flags & FL_ONGROUND))
+       //if (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE && this.move_didgravity > 0 && !IS_ONGROUND(this))
        //      this.velocity_z -= 0.5 * dt * (this.gravity ? this.gravity : 1) * PHYS_GRAVITY(this);
 
        _Movetype_CheckWaterTransition(this);
index 24c9c8c5ea64d6f8e171b85bd26ebe71c33bf311..45b1dc39ccbe4c18a978a617bc7b90120df357b1 100644 (file)
@@ -14,7 +14,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
        _Movetype_CheckVelocity(this);
 
        // do a regular slide move unless it looks like you ran into a step
-       bool oldonground = (this.flags & FL_ONGROUND);
+       bool oldonground = IS_ONGROUND(this);
 
        vector start_origin = this.origin;
        vector start_velocity = this.velocity;
@@ -43,7 +43,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 
        // if the move did not hit the ground at any point, we're not on ground
        if (!(clip & 1))
-               this.flags &= ~FL_ONGROUND;
+               UNSET_ONGROUND(this);
 
        _Movetype_CheckVelocity(this);
        _Movetype_LinkEdict(this, true);
@@ -137,7 +137,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
                        _Movetype_WallFriction(this, stepnormal);
        }
        // don't do the down move if stepdown is disabled, moving upward, not in water, or the move started offground or ended onground
-       else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || (this.flags & FL_ONGROUND))
+       else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || IS_ONGROUND(this))
        {
                return;
        }
index 598e5d1ec72753be0b2cbfbf8fcc5a9af14b7bd6..3147354ea5554f9bc001c9e536198209cb752eac 100644 (file)
@@ -68,7 +68,7 @@ void ItemDraw(entity this)
     if(this.gravity)
     {
         Movetype_Physics_MatchServer(this, false);
-        if(this.flags & FL_ONGROUND)
+        if(IS_ONGROUND(this))
         { // For some reason avelocity gets set to '0 0 0' here ...
             this.oldorigin = this.origin;
             this.gravity = 0;
@@ -107,7 +107,7 @@ void ItemDrawSimple(entity this)
     {
         Movetype_Physics_MatchServer(this, false);
 
-        if(this.flags & FL_ONGROUND)
+        if(IS_ONGROUND(this))
             this.gravity = 0;
     }
 
index 51ef002736a32201d391cc9831b9a4f84f06389f..3120aa33d90361b1e5f88a75f49f72ae0f16c220 100644 (file)
@@ -14,7 +14,7 @@ Applies some friction to this
 void SUB_Friction (entity this)
 {
        this.SUB_NEXTTHINK = time;
-       if(this.SUB_FLAGS & FL_ONGROUND)
+       if(IS_ONGROUND(this))
                this.SUB_VELOCITY = this.SUB_VELOCITY * (1 - frametime * this.friction);
 }
 
index 9d62741712619f853f9bb02ee41b2e27a435509c..096022c848644ac499c5c674e4f0fe1c709079e1 100644 (file)
@@ -10,7 +10,6 @@
 #define SUB_THINK(e, f)     setthink(e, f)
 #define SUB_THUNK(e)        getthink(e)
 #define SUB_LTIME                      ltime
-#define SUB_FLAGS                      flags
 
 
 void SUB_SetFade (entity ent, float when, float fading_time);
index be8666eb8bd1a695dc1a42ee9db394a5d9dde240..e2d6288bda494801c63155a4069181ee875151c3 100644 (file)
@@ -128,7 +128,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        setorigin(player, to);
        player.angles = to_angles;
        player.velocity = to_velocity;
-       player.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(player);
        player.iflags |= IFLAG_TELEPORTED | IFLAG_V_ANGLE | IFLAG_ANGLES;
        player.csqcmodel_teleported = 1;
        player.v_angle = to_angles;
index a0c0dd2eccfd562e45f7fa10594361e7b356701e..a0b196e1e302169522e97fdb48d5f8a3f61a297e 100644 (file)
@@ -330,7 +330,7 @@ bool bumblebee_gunner_enter(entity this, entity player)
        player.vehicle_reload1  = vehic.vehicle_reload1;
        player.vehicle_reload2  = vehic.vehicle_reload2;
        player.vehicle_energy   = vehic.vehicle_energy;
-       player.flags               &= ~FL_ONGROUND;
+       UNSET_ONGROUND(player);
 
        RemoveGrapplingHook(player);
 
index 5262ca6de3a094ff2e46c6ddddeb7ab91651fe24..974145e149aa81a744736fce107752b5e03bed7c 100644 (file)
@@ -176,7 +176,9 @@ void WarpZone_Touch(entity this, entity toucher)
 
        // FIXME needs a better check to know what is safe to teleport and what not
        if(toucher.movetype == MOVETYPE_NONE || toucher.movetype == MOVETYPE_FOLLOW || toucher.tag_entity
+#if 0
        || toucher.move_movetype == MOVETYPE_NONE || toucher.move_movetype == MOVETYPE_FOLLOW
+#endif
 #ifdef CSQC
        || tag_networkentity
 #endif