From 91a4dbe68b67c973724feb4cc1c0ab68ad33981b Mon Sep 17 00:00:00 2001 From: aurhat <6187373+aurhat@users.noreply.github.com> Date: Wed, 20 Oct 2021 23:35:13 +0200 Subject: [PATCH] fix attack animation of player1 displayed on the water Now this attack animation will be displayed on the water during grenade throwing and it already won't be displayed, if player used earlier some weapon, changed it to other and later switched back to this weapon. --- source/src/rendermodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index cae04fef..1890d458 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -977,7 +977,8 @@ void renderclient(playerent *d, const char *mdlname, const char *vwepname, int t else if(d->state==CS_EDITING) { anim = ANIM_JUMP|ANIM_END; } else if(d->state==CS_LAGGED) { anim = ANIM_SALUTE|ANIM_LOOP|ANIM_TRANSLUCENT; } else if(lastmillis-d->lastpain<300) { anim = d->crouching ? ANIM_CROUCH_PAIN : ANIM_PAIN; speed = 300.0f/4; basetime = d->lastpain; } - else if(d->weaponsel==d->lastattackweapon && lastmillis-d->lastaction<300 && d->lastpainlastaction && !d->weaponsel->reloading && (d->weaponsel->type!=GUN_GRENADE || ((grenades *)d->weaponsel)->cookingmillis>0)) + else if(d->weaponsel == d->lastattackweapon && lastmillis-d->lastaction < 300 && d->lastpain < d->lastaction && !d->weaponsel->reloading && !d->weaponchanging + && (d->weaponsel->type != GUN_GRENADE || (d == player1 ? ((grenades *)player1->weapons[GUN_GRENADE])->throwmillis : ((grenades *)d->weapons[GUN_GRENADE])->cookingmillis > 0))) { anim = d->crouching ? ANIM_CROUCH_ATTACK : ANIM_ATTACK; speed = 300.0f/8; basetime = d->lastaction; } else if(!d->onfloor && d->timeinair>50) { anim = (d->crouching ? ANIM_CROUCH_WALK : ANIM_JUMP)|ANIM_END; } else if(!d->move && !d->strafe) { anim = (d->crouching ? ANIM_CROUCH_IDLE : ANIM_IDLE)|ANIM_LOOP; }