]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix monsters that do not use MOVETYPE_STEP appearing choppy
authorMario <mario.mario@y7mail.com>
Thu, 1 Aug 2024 17:52:36 +0000 (17:52 +0000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 1 Aug 2024 17:52:36 +0000 (17:52 +0000)
Resolves https://github.com/DarkPlacesEngine/darkplaces/issues/82

Makes monster interpolation always apply to engine-networked entities with the FL_MONSTER flag.

dpdefs/progsdefs.qc
server.h
sv_send.c

index 937f0a72c14523c875735cafc6d1aab259458493..6964bff330652c246b782c4970b2c40521f4758a 100644 (file)
@@ -233,7 +233,7 @@ float       FL_FLY                                  = 1;
 float  FL_SWIM                                 = 2;
 float  FL_CLIENT                               = 8;    // set for all client edicts
 float  FL_INWATER                              = 16;   // for enter / leave water splash
-float  FL_MONSTER                              = 32;
+float  FL_MONSTER                              = 32;   // movement is smoothed on the client side by step based interpolation
 float  FL_GODMODE                              = 64;   // player cheat
 float  FL_NOTARGET                             = 128;  // player cheat
 float  FL_ITEM                                 = 256;  // extra wide size for bonus items IF sv_legacy_bbox_expand is 1
@@ -247,7 +247,7 @@ float       MOVETYPE_NONE                   = 0;    // never moves
 //float        MOVETYPE_ANGLENOCLIP    = 1;
 //float        MOVETYPE_ANGLECLIP              = 2;
 float  MOVETYPE_WALK                   = 3;    // players only
-float  MOVETYPE_STEP                   = 4;    // discrete, not real time unless fall
+float  MOVETYPE_STEP                   = 4;    // discrete, not real time unless fall, client side interpolates in steps
 float  MOVETYPE_FLY                    = 5;
 float  MOVETYPE_TOSS                   = 6;    // gravity
 float  MOVETYPE_PUSH                   = 7;    // no clip to world, push and crush
index 66caeeff8f3d6144cd1939bc1cd001637a21361a..4378e55814717e856aede3b4fc808807eeda64b6 100644 (file)
--- a/server.h
+++ b/server.h
@@ -313,7 +313,7 @@ typedef struct client_s
 #define        MOVETYPE_ANGLENOCLIP    1
 #define        MOVETYPE_ANGLECLIP              2
 #define        MOVETYPE_WALK                   3               ///< gravity
-#define        MOVETYPE_STEP                   4               ///< gravity, special edge handling
+#define        MOVETYPE_STEP                   4               ///< gravity, special edge handling, special step based client side interpolation
 #define        MOVETYPE_FLY                    5
 #define        MOVETYPE_TOSS                   6               ///< gravity
 #define        MOVETYPE_PUSH                   7               ///< no clip to world, push and crush
@@ -359,7 +359,7 @@ typedef struct client_s
 #define        FL_CONVEYOR                             4
 #define        FL_CLIENT                               8
 #define        FL_INWATER                              16
-#define        FL_MONSTER                              32
+#define        FL_MONSTER                              32      ///< movement is smoothed on the client side by step based interpolation
 #define        FL_GODMODE                              64
 #define        FL_NOTARGET                             128
 #define        FL_ITEM                                 256
index 80466451d9d34c00009c59d51af334d954a620d6..455e2ff807669552d557bb1c65421219faf6bfbe 100644 (file)
--- a/sv_send.c
+++ b/sv_send.c
@@ -577,7 +577,7 @@ static qbool SV_PrepareEntityForSending (prvm_edict_t *ent, entity_state_t *cs,
        if (f)
                cs->effects |= ((unsigned int)f & 0xff) << 24;
 
-       if (PRVM_serveredictfloat(ent, movetype) == MOVETYPE_STEP)
+       if (PRVM_serveredictfloat(ent, movetype) == MOVETYPE_STEP || ((int)PRVM_serveredictfloat(ent, flags) & FL_MONSTER))
                cs->flags |= RENDER_STEP;
        if (cs->number != sv.writeentitiestoclient_cliententitynumber && (cs->effects & EF_LOWPRECISION) && cs->origin[0] >= -32768 && cs->origin[1] >= -32768 && cs->origin[2] >= -32768 && cs->origin[0] <= 32767 && cs->origin[1] <= 32767 && cs->origin[2] <= 32767)
                cs->flags |= RENDER_LOWPRECISION;