Network the ground entity of the player for the sake of disabling stair smoothing...
authorMario <mario.mario@y7mail.com>
Mon, 3 Aug 2020 11:25:38 +0000 (21:25 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 3 Aug 2020 11:25:38 +0000 (21:25 +1000)
qcsrc/common/csqcmodel_settings.qh
qcsrc/lib/csqcmodel/cl_player.qc

index f342bdd..503cc1f 100644 (file)
 
 # define ALPHA m_alpha
 .float m_alpha;
+
+# define GROUNDENTITY_NAME ground_networkentity
+# define GROUNDENTITY_TYPE float
+.float ground_networkentity;
 #else
 # define TAG_ENTITY_NAME tag_entity
 # define TAG_ENTITY_TYPE entity
@@ -29,6 +33,9 @@
 # define TAG_VIEWLOC_TYPE entity
 
 # define ALPHA alpha
+
+# define GROUNDENTITY_NAME groundentity
+# define GROUNDENTITY_TYPE entity
 #endif
 
 // add properties you want networked to CSQC here
@@ -66,6 +73,9 @@
        CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) \
        CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, multijump_count) \
        CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, move_movetype) \
+       CSQCMODEL_IF(isplayer) \
+               CSQCMODEL_PROPERTY(BIT(17), GROUNDENTITY_TYPE, ReadShort, WriteEntity, GROUNDENTITY_NAME) \
+       CSQCMODEL_ENDIF \
        CSQCMODEL_PROPERTY(BIT(17), int, ReadByte, WriteByte, clipgroup)
 // TODO get rid of colormod/glowmod here; also get rid of some useless properties on non-players that only exist for CopyBody
 
index ef2ca0b..d8ea2a0 100644 (file)
@@ -219,7 +219,7 @@ vector CSQCPlayer_ApplySmoothing(entity this, vector v)
        float smoothtime = bound(0, time - smooth_prevtime, 0.1);
        smooth_prevtime = max(smooth_prevtime, drawtime); // drawtime is the previous frame's time at this point
 
-       if(this.csqcmodel_teleported || !(this.pmove_flags & PMF_ONGROUND) || autocvar_cl_stairsmoothspeed <= 0)
+       if(this.csqcmodel_teleported || !(this.pmove_flags & PMF_ONGROUND) || autocvar_cl_stairsmoothspeed <= 0 || this.ground_networkentity)
                stairsmoothz = v.z;
        else
        {