// don't define this ever
//#define CSQCMODEL_SUPPORT_GETTAGINFO_BEFORE_DRAW
+// server decides crouching, this lags, but so be it
+#define CSQCMODEL_SERVERSIDE_CROUCH
+
// a hack for Xonotic
#ifdef CSQC
# define TAG_ENTITY_NAME tag_networkentity
}
CSQCPlayer_PredictTo(clientcommandframe + 1, TRUE);
+#ifdef CSQCMODEL_SERVERSIDE_CROUCH
+ // get crouch state from the server (LAG)
+ if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
+ self.pmove_flags &~= PMF_DUCKED;
+ else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
+ self.pmove_flags |= PMF_DUCKED;
+#endif
+
CSQCPlayer_SetMinsMaxs();
self.angles_y = input_angles_y;
self.prevorigin = self.origin;
- if (!self.vehicle)
- if (((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss) && !self.freezetag_frozen) // FIXME-CSAD: prevent crouching if using melee attack
+ float do_crouch = self.BUTTON_CROUCH;
+ if(!self.hook.state)
+ do_crouch = 0;
+ if(self.health <= g_bloodloss)
+ do_crouch = 1;
+ if(self.vehicle)
+ do_crouch = 0;
+ if(self.freezetag_frozen)
+ do_crouch = 0;
+ if(self.weapon == WEP_SHOTGUN && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
+ do_crouch = 0;
+
+ if (do_crouch)
{
if (!self.crouch)
{
if((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)
{
- if(self.weapon == WEP_SHOTGUN && self.BUTTON_ATCK2)
+ if(self.weapon == WEP_SHOTGUN && fr == WFRAME_FIRE2)
animdecide_setaction(self, ANIMACTION_MELEE, restartanim);
else
animdecide_setaction(self, ANIMACTION_SHOOT, restartanim);
}
}
if (self.clip_load >= 0) // we are not currently reloading
- if (!self.crouch) // we are not currently crouching; this fixes an exploit where your melee anim is not visible, and besides wouldn't make much sense
+ if (!self.crouch) // no crouchmelee please
if (self.BUTTON_ATCK2 && autocvar_g_balance_shotgun_secondary)
if (weapon_prepareattack(1, autocvar_g_balance_shotgun_secondary_refire))
{