Merge pull request #408 from BenCat07/master
Fix menu float slider crash & Lagexploit fixes
This commit is contained in:
commit
695d75215b
@ -28,6 +28,10 @@ CatVar razorback(CV_SWITCH, "se_antirazorback", "0", "Anti-Razorback",
|
||||
"Stab through razorbacks");
|
||||
CatVar stickyspam(CV_SWITCH, "se_stickyspam", "0", "Sticky spam",
|
||||
"Allows Spam of stickies simply by holding Mouse1.");
|
||||
CatVar infinitecharge(CV_SWITCH, "se_infinite_charge", "0",
|
||||
"Infinite sticky charge",
|
||||
"Infinitely charge stickies, (can be used for sniping "
|
||||
"and or b1g dmg using the quickiebomb launcher)");
|
||||
CatVar cloak(CV_SWITCH, "se_cloak", "0", "Instant decloak/cloak", "");
|
||||
CatVar cap(CV_SWITCH, "se_cap", "0", "Auto instant cap", "");
|
||||
CatVar cart(CV_SWITCH, "se_cart", "0", "Farm cart points",
|
||||
@ -376,6 +380,12 @@ void CreateMove()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (g_pLocalPlayer->bAttackLastTick && infinitecharge &&
|
||||
g_pLocalPlayer->weapon()->m_iClassID ==
|
||||
(CL_CLASS(CTFPipebombLauncher)) &&
|
||||
(g_pUserCmd->buttons & IN_ATTACK) &&
|
||||
CE_BYTE(LOCAL_W, netvar.m_flChargeLevel))
|
||||
amount = (int) value;
|
||||
if (instant_weapon_switch && not HasCondition<TFCond_Cloaked>(LOCAL_E))
|
||||
{
|
||||
if (lastwep != g_pLocalPlayer->weapon()->m_iClassID)
|
||||
@ -416,7 +426,8 @@ void CreateMove()
|
||||
// m1 since a while)
|
||||
// and you are holding m1 run the Doom code
|
||||
if (doom && servertime - nextattack > 0.0f &&
|
||||
g_pUserCmd->buttons & IN_ATTACK)
|
||||
(g_pUserCmd->buttons & IN_ATTACK ||
|
||||
g_pUserCmd->buttons & IN_ATTACK2))
|
||||
{
|
||||
// Incase i ever goes below 0.1 recalculate it (or if it's just
|
||||
// inited)
|
||||
@ -426,25 +437,11 @@ void CreateMove()
|
||||
amount = i * 66;
|
||||
// Don't attack if the clip is empty so you also instantly reload
|
||||
if (!CE_BYTE(g_pLocalPlayer->weapon(), netvar.m_iClip1))
|
||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
||||
}
|
||||
// If doom is active and nextattack2 is positive (not reloading/holding
|
||||
// m2 since a while)
|
||||
// and you are holding m2 run the Doom code
|
||||
if (doom && servertime - nextattack2 > 0.0f &&
|
||||
g_pUserCmd->buttons & IN_ATTACK2)
|
||||
{
|
||||
// Incase i2 ever goes below 0.1 recalculate it (or if it's just
|
||||
// inited)
|
||||
if (i2 < 0.1f)
|
||||
i2 = servertime - nextattack2;
|
||||
// Set lagexploit amount (i * 66 = i seconds of lag)
|
||||
amount = i2 * 66;
|
||||
// if primary ammo is empty don't hold m2, not a byte check since
|
||||
// many weapons may not have a secondary clip
|
||||
if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip2) == 0)
|
||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
||||
g_pUserCmd->buttons &= ~IN_ATTACK2;
|
||||
}
|
||||
}
|
||||
// if anti-razorback is active and you can stab through the shieled
|
||||
if (razorback && servertime - nextattack > 3.0f &&
|
||||
(g_pUserCmd->buttons & IN_ATTACK))
|
||||
@ -550,16 +547,11 @@ void CreateMove()
|
||||
void Draw()
|
||||
{
|
||||
#if ENABLE_VISUALS
|
||||
if (doom && (servertime - nextattack > 0.0f || servertime - nextattack2))
|
||||
if (doom && (servertime - nextattack > 0.0f))
|
||||
{
|
||||
auto amount = servertime - nextattack;
|
||||
auto amount2 = servertime - nextattack2;
|
||||
if (amount > 0.0f)
|
||||
AddCenterString(format("Fireable Primary amount: ", (int) amount),
|
||||
colors::orange);
|
||||
if (amount2 > 0.0f)
|
||||
AddCenterString(
|
||||
format("Fireable Secondary amount: ", (int) amount2),
|
||||
AddCenterString(format("Fireable amount: ", (int) amount),
|
||||
colors::orange);
|
||||
}
|
||||
if (razorback)
|
||||
|
@ -909,7 +909,7 @@ void ConVar::InternalSetFloatValue(float fNewValue)
|
||||
if (!(m_nFlags & FCVAR_NEVER_AS_STRING))
|
||||
{
|
||||
char tempVal[32];
|
||||
Q_snprintf(tempVal, sizeof(tempVal), "%f", m_fValue);
|
||||
snprintf(tempVal, sizeof(tempVal), "%f", m_fValue);
|
||||
ChangeStringValue(tempVal, flOldValue);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user