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
{
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)
#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