Skip to content

Commit

Permalink
Added autobhop
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex109 committed Aug 3, 2024
1 parent 6988837 commit 735d822
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cod4qol/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void commands::InitializeCommands()
game::Cmd_AddCommand("toggleconsoleupdate", ToggleConsoleUpdate);
game::Cmd_AddCommand("toggleloadinginfoupdate", ToggleLoadingInfoUpdate);
game::Cmd_AddCommand("togglesteamauthupdate", ToggleSteamAuthUpdate);
game::Cmd_AddCommand("toggleenablebhopupdate", ToggleEnableBhopUpdate);
game::Cmd_AddCommand("openlink", OpenLink);

game::Cmd_AddCommand("loaddemos", LoadDemos);
Expand Down Expand Up @@ -79,6 +80,8 @@ void commands::InitializeCommands()

qol_stockmenu = game::Cvar_RegisterBool("qol_stockmenu", 0, game::dvar_flags::saved, "Load the stock menu even with a mod loaded.");

qol_enablebhop = game::Cvar_RegisterBool("qol_enablebhop", 0, game::dvar_flags::saved, "Enable auto bunny hopping.");

std::cout << "Commands initialized!" << std::endl;
}

Expand Down Expand Up @@ -244,6 +247,13 @@ void commands::ToggleSteamAuthUpdate()
}
}

void commands::ToggleEnableBhopUpdate()
{
if (commands::qol_enablebhop->current.enabled)
hooks::write_addr(0x407DE3, "\xEB", 1);
else
hooks::write_addr(0x407DE3, "\x74", 1);
}

void commands::OpenLink()
{
Expand Down
2 changes: 2 additions & 0 deletions cod4qol/commands.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace commands
inline game::dvar_s* qol_disable_steam_auth;
inline game::dvar_s* qol_ambient;
inline game::dvar_s* qol_stockmenu;
inline game::dvar_s* qol_enablebhop;
inline game::dvar_s* qol_show_mainmenuinfo;

void InitializeCommands();
Expand All @@ -43,6 +44,7 @@ namespace commands
void SetGun(game::GfxViewParms* view_parms);
void ToggleLoadingInfoUpdate();
void ToggleSteamAuthUpdate();
void ToggleEnableBhopUpdate();
void OpenLink();

void LoadDemos();
Expand Down
2 changes: 1 addition & 1 deletion cod4qol/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <vector>

#define COD4QOL_NAME "CoD4QOL"
#define COD4QOL_BASE_VERSION "1.6.0"
#define COD4QOL_BASE_VERSION "1.7.0"
#ifndef _DEBUG
#define COD4QOL_VERSION COD4QOL_BASE_VERSION
#else
Expand Down
1 change: 1 addition & 0 deletions cod4qol/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void game::hookedDB_LoadXZoneFromGfxConfig()
game::Cbuf_AddText("toggleconsoleupdate\n", 0);
game::Cbuf_AddText("toggleloadinginfoupdate\n", 0);
game::Cbuf_AddText("togglesteamauthupdate\n", 0);
game::Cbuf_AddText("toggleenablebhopupdate\n", 0);
game::Cbuf_AddText("readprotectedconfig\n", 0);

return game::pDB_LoadXZoneFromGfxConfig();
Expand Down

0 comments on commit 735d822

Please sign in to comment.