Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/core/features/autohop.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "features.hpp"

void Features::AutoHop::createMove(CUserCmd* cmd) {
if (Globals::localPlayer) {
if (Globals::localPlayer) { // Using bhop and jumpbug causes jumpbug to not work
if (CONFIGBOOL("Misc>Misc>Movement>Auto Hop")) {
if (Globals::localPlayer->moveType() == 9) return;
if (CONFIGBOOL("Misc>Misc>Movement>Jump Bug") &&
Menu::CustomWidgets::isKeyDown(CONFIGINT("Misc>Misc>Movement>Jump Bug Key"))) return;
if (CONFIGBOOL("Misc>Misc>Movement>Humanised Bhop")) {
// https://www.unknowncheats.me/forum/counterstrike-global-offensive/333797-humanised-bhop.html
static int hopsRestricted = 0;
Expand All @@ -25,8 +27,8 @@ void Features::AutoHop::createMove(CUserCmd* cmd) {
}
}
else {
if (!(Globals::localPlayer->flags() & (1<<0))) { // need to make macro for FL_*
cmd->buttons &= ~(1<<1); // need to make macro for IN_*
if (!(Globals::localPlayer->flags() & FL_ONGROUND)) {
cmd->buttons &= ~IN_JUMP;
}
}
}
Expand Down
14 changes: 6 additions & 8 deletions src/core/features/edgejump.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#include "../../includes.hpp"
#include "features.hpp"

int flagsBackup = 0;

void Features::EdgeJump::prePredCreateMove(CUserCmd* cmd) {
if (Globals::localPlayer)
flagsBackup = Globals::localPlayer->flags();
}

void Features::EdgeJump::postPredCreateMove(CUserCmd* cmd) {
if (CONFIGBOOL("Misc>Misc>Movement>Edge Jump") &&
Menu::CustomWidgets::isKeyDown(CONFIGINT("Misc>Misc>Movement>Edge Jump Key")) &&
Globals::localPlayer &&
Globals::localPlayer->moveType() != MOVETYPE_LADDER &&
Globals::localPlayer->moveType() != MOVETYPE_NOCLIP &&
flagsBackup & FL_ONGROUND &&
if (CONFIGBOOL("Misc>Misc>Movement>Edge Jump") &&
Menu::CustomWidgets::isKeyDown(CONFIGINT("Misc>Misc>Movement>Edge Jump Key")) &&
Globals::localPlayer &&
Globals::localPlayer->moveType() != MOVETYPE_LADDER &&
Globals::localPlayer->moveType() != MOVETYPE_NOCLIP &&
flagsBackup & FL_ONGROUND &&
!(Globals::localPlayer->flags() & FL_ONGROUND))
cmd->buttons |= IN_JUMP;
}
4 changes: 4 additions & 0 deletions src/core/features/features.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,9 @@ namespace Features {
namespace EdgeJump {
void prePredCreateMove(CUserCmd* cmd);
void postPredCreateMove(CUserCmd* cmd);
inline int flagsBackup;
}
namespace JumpBug {
void createMove(CUserCmd* cmd);
}
}
15 changes: 15 additions & 0 deletions src/core/features/jumpbug.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "../../includes.hpp"
#include "features.hpp"

void Features::JumpBug::createMove(CUserCmd* cmd) {
if (CONFIGBOOL("Misc>Misc>Movement>Jump Bug") &&
Interfaces::inputSystem->IsButtonDown(KEY_SPACE) &&
Menu::CustomWidgets::isKeyDown(CONFIGINT("Misc>Misc>Movement>Jump Bug Key")) &&
Globals::localPlayer->moveType() != MOVETYPE_LADDER &&
Globals::localPlayer->moveType() != MOVETYPE_NOCLIP &&
(Globals::localPlayer->flags() & FL_ONGROUND || Globals::localPlayer->flags() & FL_PARTIALGROUND) &&
!(Features::EdgeJump::flagsBackup & FL_ONGROUND || Features::EdgeJump::flagsBackup & FL_PARTIALGROUND)) {
cmd->buttons |= IN_DUCK;
cmd->buttons &= ~IN_JUMP;
}
}
1 change: 1 addition & 0 deletions src/core/hooks/createmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ bool Hooks::CreateMove::hook(void* thisptr, float flInputSampleTime, CUserCmd* c
Features::Backtrack::createMove(cmd);
Features::Forwardtrack::createMove(cmd);
}
Features::JumpBug::createMove(cmd);
Features::Prediction::end();

Features::EdgeJump::postPredCreateMove(cmd);
Expand Down
2 changes: 2 additions & 0 deletions src/core/menu/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ namespace Config {
CONFIGITEM("Misc>Misc>Movement>Bhop Max Hops Hit", 0),
CONFIGITEM("Misc>Misc>Movement>Edge Jump", false),
CONFIGITEM("Misc>Misc>Movement>Edge Jump Key", 0),
CONFIGITEM("Misc>Misc>Movement>Jump Bug", false),
CONFIGITEM("Misc>Misc>Movement>Jump Bug Key", 0),
CONFIGITEM("Misc>Misc>Movement>Fast Duck", false),

CONFIGITEM("Misc>Misc>Hitmarkers>Hitlogs", false),
Expand Down
6 changes: 6 additions & 0 deletions src/core/menu/tabs/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ void Menu::drawMiscTab() {
ImGui::SameLine();
}
ImGui::Checkbox("Edge Jump", &CONFIGBOOL("Misc>Misc>Movement>Edge Jump"));
if (CONFIGBOOL("Misc>Misc>Movement>Jump Bug")) {
static bool toggled = false;
Menu::CustomWidgets::drawKeyBinder("Key", &CONFIGINT("Misc>Misc>Movement>Jump Bug Key"), &toggled);
ImGui::SameLine();
}
ImGui::Checkbox("Jump Bug", &CONFIGBOOL("Misc>Misc>Movement>Jump Bug"));
ImGui::Checkbox("Fast Duck", &CONFIGBOOL("Misc>Misc>Movement>Fast Duck"));
ImGui::SameLine();
ImGui::TextDisabled("?");
Expand Down
29 changes: 1 addition & 28 deletions src/sdk/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,34 +511,7 @@ enum MoveType_t
#define FL_FAKECLIENT (1<<8) // Fake client, simulated server side; don't send network messages to them
// NON-PLAYER SPECIFIC (i.e., not used by GameMovement or the client .dll ) -- Can still be applied to players, though
#define FL_INWATER (1<<9) // In water

#define IN_ATTACK (1 << 0)
#define IN_JUMP (1 << 1)
#define IN_DUCK (1 << 2)
#define IN_FORWARD (1 << 3)
#define IN_BACK (1 << 4)
#define IN_USE (1 << 5)
#define IN_CANCEL (1 << 6)
#define IN_LEFT (1 << 7)
#define IN_RIGHT (1 << 8)
#define IN_MOVELEFT (1 << 9)
#define IN_MOVERIGHT (1 << 10)
#define IN_ATTACK2 (1 << 11)
#define IN_RUN (1 << 12)
#define IN_RELOAD (1 << 13)
#define IN_ALT1 (1 << 14)
#define IN_ALT2 (1 << 15)
#define IN_SCORE (1 << 16)
#define IN_SPEED (1 << 17)
#define IN_WALK (1 << 18)
#define IN_ZOOM (1 << 19)
#define IN_WEAPON1 (1 << 20)
#define IN_WEAPON2 (1 << 21)
#define IN_BULLRUSH (1 << 22)
#define IN_GRENADE1 (1 << 23)
#define IN_GRENADE2 (1 << 24)
#define IN_ATTACK3 (1 << 25)

#define FL_PARTIALGROUND (1<<17) // Not all parts of the player are on ground

// Fuzion
class AnimState {
Expand Down
57 changes: 57 additions & 0 deletions src/sdk/interfaces/iappsystem.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

struct AppSystemInfo_t
{
const char* m_pModuleName;
const char* m_pInterfaceName;
};

enum InitReturnVal_t
{
INIT_FAILED = 0,
INIT_OK,

INIT_LAST_VAL,
};

enum AppSystemTier_t
{
APP_SYSTEM_TIER0 = 0,
APP_SYSTEM_TIER1,
APP_SYSTEM_TIER2,
APP_SYSTEM_TIER3,

APP_SYSTEM_TIER_OTHER,
};

typedef void* (*CreateInterfaceFn) (const char*, int*);

class IAppSystem
{
public:
// Here's where the app systems get to learn about each other
virtual bool Connect(CreateInterfaceFn factory) = 0;

virtual void Disconnect() = 0;

// Here's where systems can access other interfaces implemented by this object
// Returns nullptr if it doesn't implement the requested interface
virtual void* QueryInterface(const char* pInterfaceName) = 0;

// Init, shutdown
virtual InitReturnVal_t Init() = 0;

virtual void Shutdown() = 0;

// Returns all dependent libraries
virtual const AppSystemInfo_t* GetDependencies() = 0;

// Returns the tier
virtual AppSystemTier_t GetTier() = 0;

// Reconnect to a particular interface
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName) = 0;

// Returns whether or not the app system is a singleton
virtual bool IsSingleton() = 0;
};
Loading