protocol robustness (based on _Flo comment)

This commit is contained in:
flowtron
2022-08-28 10:38:20 +02:00
parent 796242c145
commit da5cb69c00
+2 -1
View File
@@ -538,13 +538,14 @@ public:
void selectweapon(int w, bool other = false)
{
if(!valid_weapon(w)) return;
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 setprimary(int w) { if(!valid_weapon(w)) return; primweap = weapons[(primary = w)]; }
void setnextprimary(int w) { nextprimweap = weapons[(nextprimary = w)]; }
bool isspectating() { return state==CS_SPECTATE || (state==CS_DEAD && spectatemode > SM_NONE); }
void weaponswitch(weapon *w, bool sound = true)