From: Mario Date: Thu, 1 Aug 2024 17:52:36 +0000 (+0000) Subject: Fix monsters that do not use MOVETYPE_STEP appearing choppy X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f55c33da9cf80af51ef92f548d3b2f43d4c0441;p=xonotic%2Fdarkplaces.git Fix monsters that do not use MOVETYPE_STEP appearing choppy Resolves https://github.com/DarkPlacesEngine/darkplaces/issues/82 Makes monster interpolation always apply to engine-networked entities with the FL_MONSTER flag. --- diff --git a/dpdefs/progsdefs.qc b/dpdefs/progsdefs.qc index 937f0a72..6964bff3 100644 --- a/dpdefs/progsdefs.qc +++ b/dpdefs/progsdefs.qc @@ -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 diff --git a/server.h b/server.h index 66caeeff..4378e558 100644 --- 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 diff --git a/sv_send.c b/sv_send.c index 80466451..455e2ff8 100644 --- 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;