Skip to content

Commit

Permalink
merge request #40 from 10010101001/patch-1
Browse files Browse the repository at this point in the history
fix weapon fire animation playing while overheating
  • Loading branch information
no-lex authored Aug 1, 2021
2 parents abc4e5c + 7468d17 commit 3327d4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions game/weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,20 @@ namespace game
if(name[0])
{
int gun = getweapon(name);
if(validgun(gun) && gun != player1->gunselect && player1->ammo[gun])
if(validgun(gun) && gun != player1->gunselect && player1->ammo[gun] && weaponallowed(gun))
{
gunselect(gun, player1);
return;
}
}
else
{
weaponswitch(player1);
return;
}
}
});


void offsetray(const vec &from, const vec &to, int spread, float range, vec &dest)
{
vec offset;
Expand Down Expand Up @@ -1001,12 +1001,12 @@ namespace game
int gun = d->gunselect,
act = d->attacking,
atk = guns[gun].attacks[act];
d->lastaction = lastmillis;
d->lastattack = atk;
if(d->heat[gun] > attacks[atk].maxheat) // check if weapon has overheated
{
return;
}
d->lastaction = lastmillis;
d->lastattack = atk;
if(!d->ammo[gun])
{
if(d==player1)
Expand Down

0 comments on commit 3327d4d

Please sign in to comment.