trigger weaponswitch for others (issue #257)

This commit is contained in:
flowtron
2021-06-19 11:44:31 +02:00
parent ed75cdee8a
commit d37e73a61d
3 changed files with 12 additions and 5 deletions
+8 -1
View File
@@ -534,7 +534,14 @@ public:
curskin = nextskin[team_base(team)];
}
void selectweapon(int w) { if (weaponsel) prevweaponsel = weaponsel; weaponsel = weapons[(gunselect = w)]; if (!prevweaponsel) prevweaponsel = weaponsel; }
void selectweapon(int w, bool other = false)
{
if(weaponsel) prevweaponsel = weaponsel;
weaponsel = weapons[(gunselect = w)];
if(!prevweaponsel) prevweaponsel = weaponsel;
if(other && (prevweaponsel != weaponsel)) weaponswitch(weaponsel, true);
}
void setprimary(int w) { primweap = weapons[(primary = w)]; }
void setnextprimary(int w) { nextprimweap = weapons[(nextprimary = w)]; }
bool isspectating() { return state==CS_SPECTATE || (state==CS_DEAD && spectatemode > SM_NONE); }