Removed "targeting" bloat, made CV inline

This commit is contained in:
nullifiedcat 2017-02-25 16:40:20 +03:00
parent adaec02809
commit 440d1b0165
17 changed files with 12 additions and 214 deletions

View File

@ -1,2 +1,5 @@
#undef min #undef min
#undef max #undef max
#undef private
#undef public

View File

@ -42,23 +42,6 @@ int CatEnum::Minimum() {
return m_iMin; return m_iMin;
} }
bool CatVar::GetBool() { return m_pConVar->GetBool(); }
int CatVar::GetInt() { return m_pConVar->GetInt(); }
float CatVar::GetFloat() { return m_pConVar->GetFloat(); }
const char* CatVar::GetString() { return m_pConVar->GetString(); }
void CatVar::SetValue(float value) {
m_pConVar->SetValue(value);
}
void CatVar::SetValue(std::string value) {
m_pConVar->SetValue(value.c_str());
}
void CatVar::SetValue(int value) {
m_pConVar->SetValue(value);
}
void CatVar::Increment(int factor) { void CatVar::Increment(int factor) {
if (!m_pConVar) return; if (!m_pConVar) return;
switch (m_Type) { switch (m_Type) {

View File

@ -10,6 +10,8 @@
class ConVar; class ConVar;
#include "sdk.h"
#include "beforecheaders.h" #include "beforecheaders.h"
#include <string> #include <string>
#include <vector> #include <vector>
@ -61,13 +63,13 @@ public:
inline void SetDescription(std::string description) { m_strDescription = description; } inline void SetDescription(std::string description) { m_strDescription = description; }
inline std::string Description() { return m_strDescription; } inline std::string Description() { return m_strDescription; }
bool GetBool(); inline bool GetBool() const { return m_pConVar->GetBool(); }
int GetInt(); inline int GetInt() const { return m_pConVar->GetInt(); }
float GetFloat(); inline float GetFloat() const { return m_pConVar->GetFloat(); };
const char* GetString(); inline const char* GetString() const { return m_pConVar->GetString(); }
void SetValue(float value); inline void SetValue(float value) { m_pConVar->SetValue(value); }
void SetValue(std::string value); inline void SetValue(std::string value) { m_pConVar->SetValue(value.c_str()); }
void SetValue(int value); inline void SetValue(int value) { m_pConVar->SetValue(value); }
void Increment(int factor = 1); void Increment(int factor = 1);
void Decrement(int factor = 1); void Decrement(int factor = 1);

View File

@ -33,7 +33,6 @@
#include "sharedobj.h" #include "sharedobj.h"
#include "hooks.h" #include "hooks.h"
#include "netmessage.h" #include "netmessage.h"
#include "targeting/ITargetSystem.h"
#include "profiler.h" #include "profiler.h"
#include "gui/GUI.h" #include "gui/GUI.h"
//#include "gui/controls.h" //#include "gui/controls.h"

View File

@ -9,11 +9,6 @@
#include "../trace.h" #include "../trace.h"
#include "../targethelper.h" #include "../targethelper.h"
#include "../targeting/ITargetSystem.h"
#include "../targeting/TargetSystemSmart.h"
#include "../targeting/TargetSystemFOV.h"
#include "../targeting/TargetSystemDistance.h"
#include "../sdk.h" #include "../sdk.h"
#include "../sdk/in_buttons.h" #include "../sdk/in_buttons.h"
#include "Aimbot.h" #include "Aimbot.h"
@ -27,12 +22,7 @@ enum TargetSystem_t {
DISTANCE = 2 DISTANCE = 2
}; };
ITargetSystem* target_systems[3];
Aimbot::Aimbot() { Aimbot::Aimbot() {
target_systems[0] = new TargetSystemSmart();
target_systems[1] = new TargetSystemFOV();
target_systems[2] = new TargetSystemDistance();
m_bAimKeySwitch = false; m_bAimKeySwitch = false;
this->v_eAimKeyMode = new CatVar(CV_ENUM, "aimbot_aimkey_mode", "1", "Aimkey mode", new CatEnum({ "DISABLED", "AIMKEY", "REVERSE", "TOGGLE" }), this->v_eAimKeyMode = new CatVar(CV_ENUM, "aimbot_aimkey_mode", "1", "Aimkey mode", new CatEnum({ "DISABLED", "AIMKEY", "REVERSE", "TOGGLE" }),
"DISABLED: aimbot is always active\nAIMKEY: aimbot is active when key is down\nREVERSE: aimbot is disabled when key is down\nTOGGLE: pressing key toggles aimbot", false); "DISABLED: aimbot is always active\nAIMKEY: aimbot is active when key is down\nREVERSE: aimbot is disabled when key is down\nTOGGLE: pressing key toggles aimbot", false);

View File

@ -1,12 +0,0 @@
/*
* ITargetSystem.cpp
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#include "ITargetSystem.h"
#include "../common.h"
ITargetSystem::~ITargetSystem() {};

View File

@ -1,18 +0,0 @@
/*
* ITargetSystem.h
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#ifndef ITARGETSYSTEM_H_
#define ITARGETSYSTEM_H_
class ITargetSystem {
public:
virtual ~ITargetSystem();
virtual int GetScore(int idx) = 0;
virtual const char* Name() = 0;
};
#endif /* ITARGETSYSTEM_H_ */

View File

@ -1,15 +0,0 @@
/*
* TargetSystemDistance.cpp
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#include "TargetSystemDistance.h"
int TargetSystemDistance::GetScore(int idx) {
return 0;
}

View File

@ -1,19 +0,0 @@
/*
* TargetSystemDistance.h
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#ifndef TARGETSYSTEMDISTANCE_H_
#define TARGETSYSTEMDISTANCE_H_
#include "ITargetSystem.h"
class TargetSystemDistance : public ITargetSystem {
public:
virtual int GetScore(int idx);
inline virtual const char* Name() { return "CLOSEST ENEMY"; };
};
#endif /* TARGETSYSTEMDISTANCE_H_ */

View File

@ -1,12 +0,0 @@
/*
* TargetSystemFOV.cpp
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#include "TargetSystemFOV.h"
int TargetSystemFOV::GetScore(int idx) {
return 0;
}

View File

@ -1,19 +0,0 @@
/*
* TargetSystemFOV.h
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#ifndef TARGETSYSTEMFOV_H_
#define TARGETSYSTEMFOV_H_
#include "ITargetSystem.h"
class TargetSystemFOV : public ITargetSystem {
public:
virtual int GetScore(int idx);
inline virtual const char* Name() { return "FOV"; };
};
#endif /* TARGETSYSTEMFOV_H_ */

View File

@ -1,10 +0,0 @@
/*
* TargetSystemHealth.cpp
*
* Created on: Dec 22, 2016
* Author: nullifiedcat
*/

View File

@ -1,15 +0,0 @@
/*
* TargetSystemHealth.h
*
* Created on: Dec 22, 2016
* Author: nullifiedcat
*/
#ifndef TARGETSYSTEMHEALTH_H_
#define TARGETSYSTEMHEALTH_H_
#endif /* TARGETSYSTEMHEALTH_H_ */

View File

@ -1,10 +0,0 @@
/*
* TargetSystemMedigun.cpp
*
* Created on: Dec 22, 2016
* Author: nullifiedcat
*/

View File

@ -1,15 +0,0 @@
/*
* TargetSystemMedigun.h
*
* Created on: Dec 22, 2016
* Author: nullifiedcat
*/
#ifndef TARGETSYSTEMMEDIGUN_H_
#define TARGETSYSTEMMEDIGUN_H_
#endif /* TARGETSYSTEMMEDIGUN_H_ */

View File

@ -1,13 +0,0 @@
/*
* TargetSystemSmart.cpp
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#include "TargetSystemSmart.h"
int TargetSystemSmart::GetScore(int idx) {
return 0;
}

View File

@ -1,21 +0,0 @@
/*
* TargetSystemSmart.h
*
* Created on: Nov 30, 2016
* Author: nullifiedcat
*/
#ifndef TARGETSYSTEMSMART_H_
#define TARGETSYSTEMSMART_H_
#include "ITargetSystem.h"
class ConVar;
class TargetSystemSmart : public ITargetSystem {
public:
virtual int GetScore(int idx);
inline virtual const char* Name() { return "SMART"; };
};
#endif /* TARGETSYSTEMSMART_H_ */