diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8547b3b6..dd9e1a0db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,6 @@ name: C/C++ CI on: push: - branches: [master] paths-ignore: - '**.md' diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 0e792e09c..5ea4138dc 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -174,6 +174,8 @@ cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, n cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0, 0.0f, nullptr }; cvar_t dying_time = { "mp_dying_time", "3.0", 0, 3.0f, nullptr }; +cvar_t player_movement_legacy = { "mp_player_movement_legacy", "1", 0, 1.0f, nullptr }; +cvar_t player_movement_penalty_jump = {"mp_player_movement_penalty_jump", "100", 0, 100.0f, nullptr}; void GameDLL_Version_f() { @@ -425,6 +427,8 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&legacy_vehicle_block); CVAR_REGISTER(&dying_time); + CVAR_REGISTER(&player_movement_legacy); + CVAR_REGISTER(&player_movement_penalty_jump); CVAR_REGISTER(&deathmsg_flags); CVAR_REGISTER(&assist_damage_threshold); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index b9b9253b9..7a11628ad 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -195,6 +195,8 @@ extern cvar_t give_c4_frags; extern cvar_t hostages_rescued_ratio; extern cvar_t legacy_vehicle_block; extern cvar_t dying_time; +extern cvar_t player_movement_legacy; +extern cvar_t player_movement_penalty_jump; extern cvar_t deathmsg_flags; extern cvar_t assist_damage_threshold; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index afc528ea8..44ef21897 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -884,7 +884,14 @@ void PM_WalkMove() if (pmove->fuser2 > 0.0) { - real_t flRatio = (100 - pmove->fuser2 * 0.001 * 19) * 0.01; + real_t flRatio; + +#ifdef REGAMEDLL_ADD + if (player_movement_legacy.value == 0) + flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0 * player_movement_penalty_jump.value * pmove->frametime) * 0.01; + else +#endif + flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0) * 0.01; pmove->velocity[0] *= flRatio; pmove->velocity[1] *= flRatio; @@ -2555,11 +2562,19 @@ void EXT_FUNC __API_HOOK(PM_Jump)() if (pmove->fuser2 > 0.0f) { // NOTE: don't do it in .f (float) - real_t flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0) * 0.01; + real_t flRatio; + +#ifdef REGAMEDLL_ADD + if (player_movement_legacy.value == 0) + flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0 * player_movement_penalty_jump.value * pmove->frametime) * 0.01; + else +#endif + flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0) * 0.01; + pmove->velocity[2] *= flRatio; } - pmove->fuser2 = 1315.789429; + pmove->fuser2 = 100.0 * 1000.0 / 19.0 / 4.0; // Decay it for simulation PM_FixupGravityVelocity(); @@ -3275,7 +3290,7 @@ void EXT_FUNC __API_HOOK(PM_Move)(struct playermove_s *ppmove, int server) assert(pm_shared_initialized); pmove = ppmove; - + #ifdef REGAMEDLL_API pmoveplayer = UTIL_PlayerByIndex(pmove->player_index + 1)->CSPlayer(); #endif