]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/movetypes.qc
Declare more ints as ints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / movetypes.qc
index ddbc43de6341eea8254e273f9cf1878e482f93d6..1c3487aca3466fa2a53bed634af6b4b5dd20e665 100644 (file)
@@ -1,4 +1,3 @@
-const float STAT_MOVEFLAGS = 225;
 const float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
 #define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
 
@@ -10,41 +9,6 @@ void _Movetype_CheckVelocity() // SV_CheckVelocity
 {
 }
 
-float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents)
-{
-       switch(nativecontents)
-       {
-               case CONTENT_EMPTY:
-                       return 0;
-               case CONTENT_SOLID:
-                       return DPCONTENTS_SOLID | DPCONTENTS_OPAQUE;
-               case CONTENT_WATER:
-                       return DPCONTENTS_WATER;
-               case CONTENT_SLIME:
-                       return DPCONTENTS_SLIME;
-               case CONTENT_LAVA:
-                       return DPCONTENTS_LAVA | DPCONTENTS_NODROP;
-               case CONTENT_SKY:
-                       return DPCONTENTS_SKY | DPCONTENTS_NODROP | DPCONTENTS_OPAQUE; // to match behaviour of Q3 maps, let sky count as opaque
-       }
-       return 0;
-}
-
-float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents)
-{
-       if(supercontents & (DPCONTENTS_SOLID | DPCONTENTS_BODY))
-               return CONTENT_SOLID;
-       if(supercontents & DPCONTENTS_SKY)
-               return CONTENT_SKY;
-       if(supercontents & DPCONTENTS_LAVA)
-               return CONTENT_LAVA;
-       if(supercontents & DPCONTENTS_SLIME)
-               return CONTENT_SLIME;
-       if(supercontents & DPCONTENTS_WATER)
-               return CONTENT_WATER;
-       return CONTENT_EMPTY;
-}
-
 float _Movetype_CheckWater(entity ent) // SV_CheckWater
 {
        float supercontents;
@@ -59,7 +23,7 @@ float _Movetype_CheckWater(entity ent) // SV_CheckWater
        if(ent.move_watertype)
        if(ent.move_watertype != nativecontents)
        {
-               print(sprintf("_Movetype_CheckWater(): Original: '%d', New: '%d'\n", ent.move_watertype, nativecontents));
+               //print(sprintf("_Movetype_CheckWater(): Original: '%d', New: '%d'\n", ent.move_watertype, nativecontents));
                if(ent.contentstransition)
                        ent.contentstransition(ent.move_watertype, nativecontents);
        }
@@ -92,7 +56,7 @@ void _Movetype_CheckWaterTransition(entity ent) // SV_CheckWaterTransition
        if(!ent.move_watertype)
        {
                // just spawned here
-               if(!autocvar_sv_gameplayfix_fixedcheckwatertransition)
+               if(!autocvar_cl_gameplayfix_fixedcheckwatertransition)
                {
                        ent.move_watertype = contents;
                        ent.move_waterlevel = 1;
@@ -101,7 +65,7 @@ void _Movetype_CheckWaterTransition(entity ent) // SV_CheckWaterTransition
        }
        else if(ent.move_watertype != contents)
        {
-               print(sprintf("_Movetype_CheckWaterTransition(): Origin: %s, Direct: '%d', Original: '%d', New: '%d'\n", vtos(ent.move_origin), pointcontents(ent.move_origin), ent.move_watertype, contents));
+               //print(sprintf("_Movetype_CheckWaterTransition(): Origin: %s, Direct: '%d', Original: '%d', New: '%d'\n", vtos(ent.move_origin), pointcontents(ent.move_origin), ent.move_watertype, contents));
                if(ent.contentstransition)
                        ent.contentstransition(ent.move_watertype, contents);
        }
@@ -114,7 +78,7 @@ void _Movetype_CheckWaterTransition(entity ent) // SV_CheckWaterTransition
        else
        {
                ent.move_watertype = CONTENT_EMPTY;
-               ent.move_waterlevel = (autocvar_sv_gameplayfix_fixedcheckwatertransition ? 0 : contents);
+               ent.move_waterlevel = (autocvar_cl_gameplayfix_fixedcheckwatertransition ? 0 : contents);
        }
 }
 
@@ -259,10 +223,10 @@ float _Movetype_UnstickEntity() // SV_UnstickEntity
                if(!_Movetype_TestEntityPosition('0 0 -1' * i)) goto success;
                if(!_Movetype_TestEntityPosition('0 0 1' * i)) goto success;
        }
-       dprint(sprintf(_("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin)));
+       dprintf("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.move_origin));
        return FALSE;
 :success
-       dprint(sprintf(_("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin)));
+       dprintf("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.move_origin));
        _Movetype_LinkEdict(TRUE);
        return TRUE;
 }
@@ -313,7 +277,7 @@ float _Movetype_PushEntity(vector push, float failonstartsolid) // SV_PushEntity
        return trace_fraction;
 }
 
-#define MAX_CLIP_PLANES 5
+const float MAX_CLIP_PLANES = 5;
 void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
 {
        if(self.move_flags & FL_ONGROUND)
@@ -497,12 +461,12 @@ void Movetype_Physics_NoMatchServer() // optimized
        setorigin(self, self.move_origin);
 }
 
-void Movetype_Physics_MatchServer(float sloppy)
+void Movetype_Physics_MatchServer(bool sloppy)
 {
        Movetype_Physics_MatchTicrate(ticrate, sloppy);
 }
 
-void Movetype_Physics_MatchTicrate(float tr, float sloppy) // SV_Physics_Entity
+void Movetype_Physics_MatchTicrate(float tr, bool sloppy) // SV_Physics_Entity
 {
        float n, i, dt, movedt;