Skip to content

Commit

Permalink
move the tas setting defaults below the specialstring setter stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Jan 15, 2022
1 parent d1b2ffd commit c8c8734
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions addons/sourcemod/scripting/include/shavit/style-settings.sp
Original file line number Diff line number Diff line change
Expand Up @@ -257,36 +257,6 @@ public SMCResult OnStyleLeaveSection(SMCParser smc)
}
#endif

if (GetStyleSettingBool(gI_CurrentParserIndex, "tas"))
{
bool x;

if (!gSM_StyleKeysSet.GetValue("tas_timescale", x))
{
SetStyleSettingFloat(gI_CurrentParserIndex, "tas_timescale", -1.0);
}

if (!gSM_StyleKeysSet.GetValue("autostrafe", x))
{
SetStyleSettingInt (gI_CurrentParserIndex, "autostrafe", 1);
}

if (!gSM_StyleKeysSet.GetValue("autoprestrafe", x))
{
SetStyleSettingBool (gI_CurrentParserIndex, "autoprestrafe", true);
}

if (!gSM_StyleKeysSet.GetValue("edgejump", x))
{
SetStyleSettingBool (gI_CurrentParserIndex, "edgejump", true);
}

if (!gSM_StyleKeysSet.GetValue("autojumponstart", x))
{
SetStyleSettingBool (gI_CurrentParserIndex, "autojumponstart", true);
}
}

if (GetStyleSettingInt(gI_CurrentParserIndex, "prespeed") > 0 || GetStyleSettingInt(gI_CurrentParserIndex, "prespeed_type") > 0)
{
bool value;
Expand Down Expand Up @@ -407,6 +377,36 @@ public SMCResult OnStyleLeaveSection(SMCParser smc)
}
}

if (GetStyleSettingBool(gI_CurrentParserIndex, "tas"))
{
bool x;

if (!gSM_StyleKeysSet.GetValue("tas_timescale", x))
{
SetStyleSettingFloat(gI_CurrentParserIndex, "tas_timescale", -1.0);
}

if (!gSM_StyleKeysSet.GetValue("autostrafe", x))
{
SetStyleSettingInt (gI_CurrentParserIndex, "autostrafe", 1);
}

if (!gSM_StyleKeysSet.GetValue("autoprestrafe", x))
{
SetStyleSettingBool (gI_CurrentParserIndex, "autoprestrafe", true);
}

if (!gSM_StyleKeysSet.GetValue("edgejump", x))
{
SetStyleSettingBool (gI_CurrentParserIndex, "edgejump", true);
}

if (!gSM_StyleKeysSet.GetValue("autojumponstart", x))
{
SetStyleSettingBool (gI_CurrentParserIndex, "autojumponstart", true);
}
}

delete gSM_StyleKeysSet;
gI_CurrentParserIndex = -1;
return SMCParse_Continue;
Expand Down

0 comments on commit c8c8734

Please sign in to comment.