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.
This commit is contained in:
aurhat
2021-10-20 23:35:13 +02:00
parent 88c9364a92
commit 91a4dbe68b
+2 -1
View File
@@ -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->lastpain<d->lastaction && !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; }