]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added DP_EF_NOGUNBOB extension
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 1 Jun 2007 01:33:34 +0000 (01:33 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 1 Jun 2007 01:33:34 +0000 (01:33 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7384 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
protocol.h
svvm_cmds.c

index 4be3ee7bf621edc7626a9b2e03b50c39574666c2..40d9c249a09f15821968ff040f1bcf6f1c445d3d 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -900,7 +900,10 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
        else if (e->render.flags & RENDER_VIEWMODEL)
        {
                // view-relative entity (guns and such)
-               matrix = &viewmodelmatrix;
+               if (e->render.effects & EF_NOGUNBOB)
+                       matrix = &r_view.matrix; // really attached to view
+               else
+                       matrix = &viewmodelmatrix; // attached to gun bob matrix
        }
        else
        {
@@ -1218,7 +1221,7 @@ void CL_UpdateViewModel(void)
                        ent->state_current.modelindex = 0;
        }
        ent->state_current.alpha = cl.entities[cl.viewentity].state_current.alpha;
-       ent->state_current.effects = EF_NOSHADOW | (cl.entities[cl.viewentity].state_current.effects & (EF_ADDITIVE | EF_FULLBRIGHT | EF_NODEPTHTEST));
+       ent->state_current.effects = EF_NOSHADOW | (cl.entities[cl.viewentity].state_current.effects & (EF_ADDITIVE | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB));
 
        // reset animation interpolation on weaponmodel if model changed
        if (ent->state_previous.modelindex != ent->state_current.modelindex)
index 17a6c45a2ac587c8672e79aa3405b682de023333..ddc9542c16f6466c1e02a2e78a31b4bb80adb29b 100644 (file)
@@ -49,7 +49,7 @@ void Protocol_Names(char *buffer, size_t buffersize);
 #define EF_ADDITIVE                            32
 #define EF_BLUE                                        64
 #define EF_RED                                 128
-#define EF_UNUSED8                             256
+#define EF_NOGUNBOB                            256                     // LordHavoc: when used with .viewmodelforclient this makes the entity attach to the view without gun bobbing and such effects, it also works on the player entity to disable gun bobbing of the engine-managed .viewmodel (without affecting any .viewmodelforclient entities attached to the player)
 #define EF_FULLBRIGHT                  512                     // LordHavoc: fullbright
 #define EF_FLAME                               1024            // LordHavoc: on fire
 #define EF_STARDUST                            2048            // LordHavoc: showering sparks
index 76eaf97e57d8d4290d97e0557eba5de54d997967..92b004dc66e4bf264762a578f4882dfa02c7a05e 100644 (file)
@@ -23,6 +23,7 @@ char *vm_sv_extensions =
 "DP_EF_NODEPTHTEST "
 "DP_EF_NODRAW "
 "DP_EF_NOSHADOW "
+"DP_EF_NOGUNBOB "
 "DP_EF_RED "
 "DP_EF_STARDUST "
 "DP_ENT_ALPHA "