]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 f342bdde7f0fe29d4406e220d8ec0b81fc3e2d59..503cc1f22df278ac676f075a10f84287eac5ef03 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 ef2ca0b9f26b43f35ab02a28030c064b2a8cabee..d8ea2a070c4cb26031d99965d3a6d018c39ff4a9 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
        {