diff --git a/addons/sourcemod/configs/shavit-styles.cfg b/addons/sourcemod/configs/shavit-styles.cfg index 96a19b1d..8c4c68cb 100644 --- a/addons/sourcemod/configs/shavit-styles.cfg +++ b/addons/sourcemod/configs/shavit-styles.cfg @@ -26,7 +26,7 @@ "runspeed" "260.00" // Running speed. Requires DHooks, shavit-misc and shavit_misc_staticprestrafe set to 1. "gravity" "1.0" // Gravity setting, 1.0 for default. Standard for low gravity styles is 0.6. "speed" "1.0" // Speed multiplier, 1.0 for default. Standard for slowmo styles is 0.5. - "halftime" "0" // Calculation of times will be halved, replays WILL NOT function properly. + "timescale" "1.0" // Timing will scale with this setting. "velocity" "1.0" // % of horizontal velocity to keep per jump. a value 0.9 will make the player lose 10% of their velocity per jump. Likewise, values above 1 will result in speed gains. "bonus_velocity" "0.0" // Bonus velocity to gain per jump. If set to e.g. 100.0, the player will gain 100 bonus velocity per jump. "min_velocity" "0.0" // Minimum amount of horizontal velocity to keep per jump. If set to 600.0, the player can't have less than 600 velocity per jump. @@ -220,7 +220,7 @@ "clantag" "SLOW" "speed" "0.5" - "halftime" "1" + "timescale" "0.5" "unranked" "1" } diff --git a/addons/sourcemod/scripting/include/shavit.inc b/addons/sourcemod/scripting/include/shavit.inc index a75efa89..e1de9021 100644 --- a/addons/sourcemod/scripting/include/shavit.inc +++ b/addons/sourcemod/scripting/include/shavit.inc @@ -98,7 +98,7 @@ enum fRunspeed, fGravityMultiplier, fSpeedMultiplier, - bHalftime, + fTimescale, fVelocity, fBonusVelocity, fMinVelocity, diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 7014bb11..7ccfb88d 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -1576,7 +1576,7 @@ bool LoadStyles() gA_StyleSettings[i][fRunspeed] = kv.GetFloat("runspeed", 260.00); gA_StyleSettings[i][fGravityMultiplier] = kv.GetFloat("gravity", 1.0); gA_StyleSettings[i][fSpeedMultiplier] = kv.GetFloat("speed", 1.0); - gA_StyleSettings[i][bHalftime] = view_as(kv.GetNum("halftime", 0)); + gA_StyleSettings[i][fTimescale] = view_as(kv.GetNum("halftime", 0))? 0.5:kv.GetFloat("timescale", 1.0); // backwards compat for old halftime setting gA_StyleSettings[i][fVelocity] = kv.GetFloat("velocity", 1.0); gA_StyleSettings[i][fBonusVelocity] = kv.GetFloat("bonus_velocity", 0.0); gA_StyleSettings[i][fMinVelocity] = kv.GetFloat("min_velocity", 0.0); @@ -1938,12 +1938,7 @@ public void OnGameFrame() continue; } - float time = frametime; - - if(gA_StyleSettings[gI_Style[i]][bHalftime]) - { - time /= 2.0; - } + float time = frametime * view_as(gA_StyleSettings[gI_Style[i]][fTimescale]); any[] snapshot = new any[TIMERSNAPSHOT_SIZE]; snapshot[bTimerEnabled] = gB_TimerEnabled[i];