From 63517e3de3ac163f7f762a6c3bfc0bbbbcaa730d Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 23 Mar 2025 16:54:51 +0100 Subject: [PATCH] make stretchfactor a cv_float again for easier handling now that we can use sliders this should hopefully work without issues --- src/k_kart.c | 9 +++------ src/m_menu.c | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 082389863..5ff9eb654 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -162,11 +162,8 @@ consvar_t cv_battlespeedo = {"battlespeedo", "Off", CV_SAVE, CV_OnOff, NULL, 0, consvar_t cv_blendeffects = {"testblendeffects", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // funn-E streeetch -static CV_PossibleValue_t stretchfactor_t[] = { - {0, "Off"}, {FRACUNIT/4, "0.250"}, - {3*FRACUNIT/8, "0.375"}, {FRACUNIT/2, "0.500"}, {5*FRACUNIT/8, "0.625"}, - {3*FRACUNIT/4, "0.750"}, {7*FRACUNIT/8, "0.875"}, {FRACUNIT, "Max"}, {0, NULL}}; -consvar_t cv_gravstretch = {"gravstretch", "0", CV_SAVE, stretchfactor_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t stretchfactor_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}}; +consvar_t cv_gravstretch = {"gravstretch", "MIN", CV_SAVE|CV_FLOAT, stretchfactor_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t slamsound_t[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; consvar_t cv_slamsound = {"slamsound", "1", CV_SAVE, slamsound_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -3461,7 +3458,7 @@ static void K_StretchPlayerGravity(player_t *p) fixed_t mos = FRACUNIT; fixed_t rzs = abs(p->mo->momz); fixed_t zspd = abs(rzs/mos); - fixed_t stretchScaleFactor = FixedDiv(FRACUNIT*60, cv_gravstretch.value); + fixed_t stretchScaleFactor = FixedDiv(FRACUNIT*60, FLOAT_TO_FIXED(cv_gravstretch.value)); fixed_t rzsDiv, slamDiv; fixed_t dxs = p->mo->realxscale; diff --git a/src/m_menu.c b/src/m_menu.c index cbb6fb068..71d281462 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2295,7 +2295,7 @@ static menuitem_t OP_PlayerDistortMenu[] = {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 60}, {IT_STRING | IT_CVAR, NULL, "Rotate Bananas on Throw", &cv_bananthrowroll, 75}, - {IT_STRING | IT_CVAR, NULL, "Player Stretch Factor", &cv_gravstretch, 90}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Player Stretch Factor", &cv_gravstretch, 90}, {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 105}, {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 120}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saltyhop Height", &cv_saltyheight, 135},