]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Hopefully fix issues with vaporizer beam
authorMario <mario@smbclan.net>
Tue, 1 Dec 2015 12:28:34 +0000 (22:28 +1000)
committerMario <mario@smbclan.net>
Tue, 1 Dec 2015 12:28:34 +0000 (22:28 +1000)
qcsrc/common/movetypes/movetypes.qc
qcsrc/common/movetypes/toss.qc
qcsrc/common/physics.qc
qcsrc/common/weapons/weapon/vaporizer.qc

index be592e7743a91fa37d6037b87a0654ae1ec06f11..e3ebd98ab90df209e2f5feeda065198c134df2de 100644 (file)
@@ -588,6 +588,8 @@ void _Movetype_Physics_Frame(entity this, float movedt)
                case MOVETYPE_FLY_WORLDONLY:
                        _Movetype_Physics_Toss(this, movedt);
                        break;
+               case MOVETYPE_PHYSICS:
+                       break;
        }
 }
 
index 51d6b6e13c500df41a65c2780f2bb349d6fefac6..3029c9a9df8b4385ffd3c541de993648dd73b787 100644 (file)
@@ -4,7 +4,7 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
 {
        if (this.move_flags & FL_ONGROUND)
        {
-               if (this.move_velocity.z >= 1 / 32)
+               if (this.move_velocity.z >= 1 / 32 && UPWARD_VELOCITY_CLEARS_ONGROUND)
                {
                        this.move_flags &= ~FL_ONGROUND;
                }
index d21579fa653f422d90d239e94a2325e6ea33a127..c4f0f4ce3f75ce8dda5be71301de740836d84a03 100644 (file)
@@ -122,7 +122,8 @@ void PM_ClientMovement_UpdateStatus(entity this, bool ground)
 {
 #ifdef CSQC
        // make sure player is not stuck
-       PM_ClientMovement_Unstick(this);
+       if(autocvar_cl_movement != 3)
+               PM_ClientMovement_Unstick(this);
 
        // set crouched
        if (PHYS_INPUT_BUTTON_CROUCH(this))
@@ -158,27 +159,30 @@ void PM_ClientMovement_UpdateStatus(entity this, bool ground)
                        UNSET_ONGROUND(this);
        }
 
-       // set watertype/waterlevel
-       origin1 = this.origin;
-       origin1.z += this.mins_z + 1;
-       this.waterlevel = WATERLEVEL_NONE;
+       if(autocvar_cl_movement != 3)
+       {
+               // set watertype/waterlevel
+               origin1 = this.origin;
+               origin1.z += this.mins_z + 1;
+               this.waterlevel = WATERLEVEL_NONE;
 
-       int thepoint = pointcontents(origin1);
+               int thepoint = pointcontents(origin1);
 
-       this.watertype = (thepoint == CONTENT_WATER || thepoint == CONTENT_LAVA || thepoint == CONTENT_SLIME);
+               this.watertype = (thepoint == CONTENT_WATER || thepoint == CONTENT_LAVA || thepoint == CONTENT_SLIME);
 
-       if (this.watertype)
-       {
-               this.waterlevel = WATERLEVEL_WETFEET;
-               origin1.z = this.origin.z + (this.mins.z + this.maxs.z) * 0.5;
-               thepoint = pointcontents(origin1);
-               if (thepoint == CONTENT_WATER || thepoint == CONTENT_LAVA || thepoint == CONTENT_SLIME)
+               if (this.watertype)
                {
-                       this.waterlevel = WATERLEVEL_SWIMMING;
-                       origin1.z = this.origin.z + 22;
+                       this.waterlevel = WATERLEVEL_WETFEET;
+                       origin1.z = this.origin.z + (this.mins.z + this.maxs.z) * 0.5;
                        thepoint = pointcontents(origin1);
                        if (thepoint == CONTENT_WATER || thepoint == CONTENT_LAVA || thepoint == CONTENT_SLIME)
-                               this.waterlevel = WATERLEVEL_SUBMERGED;
+                       {
+                               this.waterlevel = WATERLEVEL_SWIMMING;
+                               origin1.z = this.origin.z + 22;
+                               thepoint = pointcontents(origin1);
+                               if (thepoint == CONTENT_WATER || thepoint == CONTENT_LAVA || thepoint == CONTENT_SLIME)
+                                       this.waterlevel = WATERLEVEL_SUBMERGED;
+                       }
                }
        }
 
index 6e7e386e5de48ef6b89101280ea01b3e2c5e79e7..a3c4c1f97db9db76f1710982eeb4e204ac4dee0a 100644 (file)
@@ -71,7 +71,7 @@ void SendCSQCVaporizerBeamParticle(entity player, int hit) {
        WriteCoord(MSG_BROADCAST, v.y);
        WriteCoord(MSG_BROADCAST, v.z);
        WriteByte(MSG_BROADCAST, hit);
-       WriteShort(MSG_BROADCAST, num_for_edict(player));
+       WriteByte(MSG_BROADCAST, num_for_edict(player));
        WriteByte(MSG_BROADCAST, player.team);
 }
 #elif defined(CSQC)
@@ -103,7 +103,15 @@ void VaporizerBeam_Draw(entity this)
        string tex = "particles/lgbeam";
        if(this.cnt)
                tex = "particles/gauntletbeam";
-       vector rgb = getcsqcplayercolor(this.sv_entnum - 1);
+       vector rgb;
+       //entity e = CSQCModel_server2csqc(this.sv_entnum - 1);
+       //if (e == NULL)
+       //{
+               rgb = colormapPaletteColor(stof(getplayerkeyvalue(this.sv_entnum - 1, "colors")) & 0x0F, true);
+               //rgb = '1 1 1';
+       //}
+       //else
+       //      rgb = e.glowmod;
        rgb *= (1 + autocvar_cl_vaporizerbeam_colorboost);
 
        float fail = (self.nextthink - time);
@@ -133,7 +141,9 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
        this.vorg1_x = ReadCoord(); this.vorg1_y = ReadCoord(); this.vorg1_z = ReadCoord();
        this.vorg2_x = ReadCoord(); this.vorg2_y = ReadCoord(); this.vorg2_z = ReadCoord();
        this.cnt = ReadByte();
-       this.sv_entnum = ReadShort();
+       int myowner = ReadByte();
+       this.owner = playerslots[myowner - 1];
+       this.sv_entnum = myowner;
        this.team = ReadByte() - 1;
 
        if(autocvar_cl_vaporizerbeam_particle)