});
FOREACH(Weapons, it != WEP_Null && (cmd == it.netname || cmd == it.m_deprecated_netname), {
got += GiveWeapon(e, it.m_id, op, val);
- last_wep = it;
+ if(use_cts_autoswitch && CS_CVAR(e).cvar_cl_autoswitch_cts == 1)
+ if(val > 0 && (op == OP_SET && op == OP_PLUS || op == OP_MIN)) // switch to any given weapons, even if we already had it
+ last_wep = it; // (... non-CTS autoswitching can switch to a weapon we already have, so CTS autoswitch should be the same)
break;
});
break;
if(e.statuseffects)
StatusEffects_update(e);
- if(last_wep != WEP_Null && use_cts_autoswitch)
+ if(use_cts_autoswitch)
{
// CTS handling: never switch (0), always switch (1)
+ if(last_wep != WEP_Null)
if(CS_CVAR(e).cvar_cl_autoswitch_cts == 1)
{
// crude hack to enforce switching weapons
seta cl_race_checkpoint_splits_console 1 "print race checkpoint splits to console"
seta cl_race_checkpoint_splits_hud 1 "show race checkpoint splits on HUD in infomessages"
-seta cl_autoswitch_cts -1 "\"-1\" = fallback to the behavior of cl_autoswitch, \"0\" = never autoswitch in CTS, \"1\" = always autoswitch in CTS"
+seta cl_autoswitch_cts -1 "\"-1\" = fallback to the behavior of cl_autoswitch, \"0\" = never autoswitch in CTS, \"1\" = always autoswitch in CTS (regardless of weapon priority)"
set cl_stripcolorcodes 0 "experimental feature (NOTE: strips ALL color codes from messages!)"