refactoring

This commit is contained in:
nullifiedcat 2016-12-03 12:33:57 +03:00
parent 4ecc2b1ca3
commit 6d3cea6683
32 changed files with 128 additions and 186 deletions

View File

@ -24,13 +24,13 @@ AutoSticky
No AutoShoot when disguised
Fixing NoZoom flickering
Ambassador bodyshotting
No Aim Mediguns
No Trigger Mediguns
FOV = Float
More projectile weapons aimbot (wrap assassin, wrangler, stickybomb, airstrike)
Recalculate rifles' headshot ability (Bazaar + Precision rifles)
Auto Uber Flash
Auto trigger DR before rockets
AutoHeal
Airstuck
Critical rifles bodyshotting
Show spectators
Tracers/Spy Alert/Spy Cam

View File

@ -529,23 +529,14 @@ enum weaponmode {
weapon_projectile,
weapon_melee,
weapon_pda,
weapon_medigun
weapon_medigun,
weapon_consumable
};
enum hitbox {
hb_head = 0
};
enum weapons {
WP_SNIPERRIFLE = 295,
WP_ROCKET_LAUNCHER = 282,
WP_DIRECT_HIT = 284,
WP_GRENADE_LAUNCHER = 211,
WP_HUNTSMAN = 197,
WP_SANDMAN = 188,
WP_FLAREGUN = 205
};
enum relation {
NEUTRAL = 0,
FRIEND = 1,

View File

@ -24,13 +24,8 @@
#include "hooks.h"
#include "hacks/IHack.h"
#include "helpers.h"
#include "hacks/HBunnyhop.h"
#include "hacks/HTrigger.h"
#include "followbot/ipcctl.h"
#include "hacks/AutoReflect.h"
#include "hacks/HEsp.h"
//#include "hacks/HGlow.h"
#include "hacks/HAimbot.h"
#include "hacks/AntiAim.h"
#include "hacks/Misc.h"
#include "hacks/AntiDisguise.h"
@ -68,6 +63,10 @@
#include "CDumper.h"
#include "hacks/FollowBot.h"
#include "globals.h"
#include "hacks/Aimbot.h"
#include "hacks/Bunnyhop.h"
#include "hacks/ESP.h"
#include "hacks/Trigger.h"
/*
* Credits to josh33901 aka F1ssi0N for butifel F1Public and Darkstorm 2015 Linux
@ -177,7 +176,19 @@ ICvar* g_pCVar = 0;
void hack::InitHacks() {
hack::AddHack(g_phAutoStrafe = new AutoStrafe());
ADD_HACK(AutoStrafe);
ADD_HACK(AntiAim);
ADD_HACK(AntiDisguise);
ADD_HACK(AutoReflect);
ADD_HACK(FollowBot);
ADD_HACK(Misc);
ADD_HACK(Aimbot);
ADD_HACK(Bunnyhop);
ADD_HACK(ESP);
ADD_HACK(Triggerbot);
ADD_HACK(AutoSticky);
ADD_HACK(Airstuck);
/*hack::AddHack(g_phAutoStrafe = new AutoStrafe());
hack::AddHack(g_phAntiAim = new AntiAim());
hack::AddHack(g_phAntiDisguise = new AntiDisguise());
hack::AddHack(g_phAutoReflect = new AutoReflect());
@ -188,7 +199,7 @@ void hack::InitHacks() {
hack::AddHack(g_phEsp = new HEsp());
hack::AddHack(g_phTrigger = new HTrigger());
hack::AddHack(g_phAutoSticky = new AutoSticky());
hack::AddHack(g_phAirstuck = new Airstuck());
hack::AddHack(g_phAirstuck = new Airstuck());*/
}
void hack::Initialize() {

View File

@ -10,6 +10,9 @@
#include <vector>
#define ADD_HACK(x) \
hack::AddHack(g_ph##x = new x());
class IHack;
class CUserCmd;
class CViewSetup;

View File

@ -5,8 +5,6 @@
* Author: nullifiedcat
*/
#include "HAimbot.h"
#include "../usercmd.h"
#include "../helpers.h"
#include "../entity.h"
@ -31,6 +29,9 @@
#include <globalvars_base.h>
#include <inputsystem/iinputsystem.h>
#include "../sdk/in_buttons.h"
#include "Aimbot.h"
DEFINE_HACK_SINGLETON(Aimbot);
Vector viewangles_old;
bool fix_silent;
@ -45,12 +46,12 @@ enum TargetSystem_t {
ITargetSystem* target_systems[3];
const char* HAimbot::GetName() {
const char* Aimbot::GetName() {
return "AIMBOT";
}
/* null-safe */
HAimbot::HAimbot() {
Aimbot::Aimbot() {
target_systems[0] = new TargetSystemSmart();
target_systems[1] = new TargetSystemFOV();
target_systems[2] = new TargetSystemDistance();
@ -84,7 +85,7 @@ HAimbot::HAimbot() {
fix_silent = false;
}
bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
bool Aimbot::CreateMove(void*, float, CUserCmd* cmd) {
if (!this->v_bEnabled->GetBool()) return true;
this->m_iLastTarget = -1;
if (this->v_iAimKey->GetBool()) {
@ -95,7 +96,15 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
}
}
switch (GetWeaponMode(g_pLocalPlayer->entity)) {
case weapon_medigun:
case weapon_pda:
case weapon_consumable:
return true;
};
if (g_pLocalPlayer->cond_0 & cond::cloaked) return true; // TODO other kinds of cloak
// TODO m_bFeignDeathReady no aim
if (this->v_bActiveOnlyWhenCanShoot->GetBool() && !BulletTime()) return true;
@ -215,7 +224,7 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
return !this->v_bSilent->GetBool();
}
void HAimbot::PaintTraverse(void*, unsigned int, bool, bool) {
void Aimbot::PaintTraverse(void*, unsigned int, bool, bool) {
if (!v_bEnabled->GetBool()) return;
if (this->m_iLastTarget == -1) return;
IClientEntity* ent = interfaces::entityList->GetClientEntity(this->m_iLastTarget);
@ -231,7 +240,7 @@ void HAimbot::PaintTraverse(void*, unsigned int, bool, bool) {
}
}
bool HAimbot::ShouldTarget(IClientEntity* entity) {
bool Aimbot::ShouldTarget(IClientEntity* entity) {
if (!entity) return false;
if (entity->IsDormant()) return false;
if (IsPlayer(entity)) {
@ -310,7 +319,7 @@ void PredictPosition(Vector vec, IClientEntity* ent) {
vec += vel * latency;
}
bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
bool Aimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
Vector hit;
Vector angles;
if (!entity) return false;
@ -361,5 +370,3 @@ bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
}
return true;
}
HAimbot* g_phAimbot = 0;

View File

@ -13,10 +13,10 @@
class ConVar;
class IClientEntity;
class HAimbot : public IHack {
class Aimbot : public IHack {
public:
DECLARE_HACK_METHODS();
HAimbot();
Aimbot();
bool ShouldTarget(IClientEntity* entity);
bool Aim(IClientEntity* entity, CUserCmd* cmd);
@ -57,6 +57,6 @@ public:
ConVar* v_iPriorityMode;
};
extern HAimbot* g_phAimbot;
DECLARE_HACK_SINGLETON(Aimbot);
#endif /* HAIMBOT_H_ */

View File

@ -15,6 +15,8 @@
#include "../fixsdk.h"
#include <icvar.h>
DEFINE_HACK_SINGLETON(Airstuck);
Airstuck::Airstuck() {
v_bStuck = CreateConVar("u_airstuck", "0", "Toggle airstuck");
}
@ -39,5 +41,3 @@ bool Airstuck::CreateMove(void*, float, CUserCmd* cmd) {
}
void Airstuck::PaintTraverse(void*, unsigned int, bool, bool) {};
Airstuck* g_phAirstuck = 0;

View File

@ -18,6 +18,6 @@ public:
ConVar* v_bStuck;
};
extern Airstuck* g_phAirstuck;
DECLARE_HACK_SINGLETON(Airstuck);
#endif /* HACKS_AIRSTUCK_H_ */

View File

@ -11,6 +11,8 @@
#include "../helpers.h"
#include "../sdk/in_buttons.h"
DEFINE_HACK_SINGLETON(AntiAim);
const char* AntiAim::GetName() {
return "ANTI-AIM";
}
@ -38,5 +40,3 @@ bool AntiAim::CreateMove(void*, float, CUserCmd* cmd) {
}
void AntiAim::PaintTraverse(void*, unsigned int, bool, bool) {}
AntiAim* g_phAntiAim = 0;

View File

@ -19,6 +19,6 @@ public:
ConVar* v_flPitch;
};
extern AntiAim* g_phAntiAim;
DECLARE_HACK_SINGLETON(AntiAim);
#endif /* ANTIAIM_H_ */

View File

@ -15,6 +15,8 @@
#include <client_class.h>
#include <icliententity.h>
DEFINE_HACK_SINGLETON(AntiDisguise);
const char* AntiDisguise::GetName() {
return "ANTI-DISGUISE";
}
@ -37,5 +39,3 @@ void AntiDisguise::PaintTraverse(void*, unsigned int, bool, bool) {
}
bool AntiDisguise::CreateMove(void*, float, CUserCmd*) {return true;}
AntiDisguise* g_phAntiDisguise = 0;

View File

@ -17,6 +17,6 @@ public:
ConVar* v_bEnabled;
};
extern AntiDisguise* g_phAntiDisguise;
DECLARE_HACK_SINGLETON(AntiDisguise);
#endif /* HACKS_ANTIDISGUISE_H_ */

View File

@ -21,6 +21,8 @@
#include <convar.h>
#include <client_class.h>
DEFINE_HACK_SINGLETON(AutoReflect);
const char* AutoReflect::GetName() {
return "AUTO-REFLECT";
}
@ -85,4 +87,3 @@ bool AutoReflect::CreateMove(void*, float, CUserCmd* cmd) {
void AutoReflect::PaintTraverse(void*, unsigned int, bool, bool) {}
AutoReflect* g_phAutoReflect = 0;

View File

@ -22,6 +22,6 @@ public:
ConVar* v_iReflectDistance;
};
extern AutoReflect* g_phAutoReflect;
DECLARE_HACK_SINGLETON(AutoReflect);
#endif /* HACKS_AUTOREFLECT_H_ */

View File

@ -19,6 +19,8 @@
#include <icliententitylist.h>
#include <icliententity.h>
DEFINE_HACK_SINGLETON(AutoSticky);
const char* AutoSticky::GetName() {
return "AUTO-STICKY";
}
@ -67,5 +69,3 @@ bool AutoSticky::CreateMove(void*, float, CUserCmd* cmd) {
void AutoSticky::PaintTraverse(void*, unsigned int, bool, bool) {
}
DEFINE_HACK_SINGLETON(AutoSticky);

View File

@ -12,6 +12,8 @@
#include "../localplayer.h"
#include "../usercmd.h"
DEFINE_HACK_SINGLETON(AutoStrafe);
const char* AutoStrafe::GetName() {
return "AUTOSTRAFE";
}
@ -33,5 +35,3 @@ bool AutoStrafe::CreateMove(void*, float, CUserCmd* cmd) {
}
void AutoStrafe::PaintTraverse(void*, unsigned int, bool, bool) {}
AutoStrafe* g_phAutoStrafe = 0;

View File

@ -17,6 +17,6 @@ public:
ConVar* v_bEnabled;
};
extern AutoStrafe* g_phAutoStrafe;
DECLARE_HACK_SINGLETON(AutoStrafe);
#endif /* HACKS_AUTOSTRAFE_H_ */

View File

@ -5,8 +5,6 @@
* Author: nullifiedcat
*/
#include "HBunnyhop.h"
#include "../usercmd.h"
#include "../interfaces.h"
#include "../entity.h"
@ -19,18 +17,21 @@
#include <icliententitylist.h>
#include <icliententity.h>
#include <tier1/convar.h>
#include "Bunnyhop.h"
const char* HBunnyhop::GetName() {
DEFINE_HACK_SINGLETON(Bunnyhop);
const char* Bunnyhop::GetName() {
return "BUNNYHOP";
}
HBunnyhop::HBunnyhop() {
Bunnyhop::Bunnyhop() {
this->v_bEnabled = CreateConVar("u_bhop_enabled", "1", "Enable/Disable BunnyHop");
}
bool bDoubleJumpFix = false;
bool HBunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) {
bool Bunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) {
if (!this->v_bEnabled->GetBool()) return true;
int player = interfaces::engineClient->GetLocalPlayer();
IClientEntity* entity = interfaces::entityList->GetClientEntity(player);
@ -55,7 +56,4 @@ bool HBunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) {
return true;
}
void HBunnyhop::PaintTraverse(void*, unsigned int, bool, bool) {}
HBunnyhop* g_phBunnyhop = 0;
void Bunnyhop::PaintTraverse(void*, unsigned int, bool, bool) {}

View File

@ -12,13 +12,13 @@
class ConVar;
class HBunnyhop : public IHack {
class Bunnyhop : public IHack {
public:
DECLARE_HACK_METHODS();
HBunnyhop();
Bunnyhop();
ConVar* v_bEnabled;
};
extern HBunnyhop* g_phBunnyhop;
DECLARE_HACK_SINGLETON(Bunnyhop);
#endif /* HBUNNYHOP_H_ */

View File

@ -5,7 +5,8 @@
* Author: nullifiedcat
*/
#include "HEsp.h"
#include "ESP.h"
#include "../fixsdk.h"
#include "../drawing.h"
#include "../interfaces.h"
@ -24,7 +25,9 @@
#include <tier1/convar.h>
#include <cmodel.h>
const char* HEsp::GetName() {
DEFINE_HACK_SINGLETON(ESP);
const char* ESP::GetName() {
return "ESP";
}
@ -40,13 +43,13 @@ const char* classes[] = {
"Engineer"
};
void HEsp::PaintTraverse(void*, unsigned int, bool, bool) {
void ESP::PaintTraverse(void*, unsigned int, bool, bool) {
for (int i = 0; i < gEntityCache.m_nMax; i++) {
ProcessEntityPT(gEntityCache.GetEntity(i));
}
}
HEsp::HEsp() {
ESP::ESP() {
this->v_bEnabled = CreateConVar("u_esp_enabled", "1", "Enables ESP");
this->v_bEntityESP = CreateConVar("u_esp_entity", "0", "Entity ESP (dev)");
this->v_bTeammates = CreateConVar("u_esp_teammates", "0", "ESP own team");
@ -69,7 +72,7 @@ HEsp::HEsp() {
#define ESP_HEIGHT 14
void HEsp::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) {
void ESP::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) {
if (!CheckCE(ent)) return;
Vector min, max;
ent->m_pEntity->GetRenderBounds(min, max);
@ -109,7 +112,7 @@ void HEsp::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHei
//draw::OutlineRect(min(smin.x, smax.x), min(smin.y, smax.y), max(smin.x, smax.x), max(smin.y, smax.y), clr);
}
void HEsp::ProcessEntityPT(CachedEntity* ent) {
void ESP::ProcessEntityPT(CachedEntity* ent) {
if (!this->v_bEnabled->GetBool()) return;
if (!this->v_bBox->GetBool()) return;
if (!CheckCE(ent)) return;
@ -153,7 +156,7 @@ void HEsp::ProcessEntityPT(CachedEntity* ent) {
}
}
void HEsp::ProcessEntity(CachedEntity* ent) {
void ESP::ProcessEntity(CachedEntity* ent) {
if (!this->v_bEnabled->GetBool()) return;
if (!CheckCE(ent)) return;
@ -373,13 +376,9 @@ void HEsp::ProcessEntity(CachedEntity* ent) {
}*/
}
bool HEsp::CreateMove(void*, float, CUserCmd*) {
bool ESP::CreateMove(void*, float, CUserCmd*) {
for (int i = 0; i < gEntityCache.m_nMax; i++) {
ProcessEntity(gEntityCache.GetEntity(i));
}
return true;
};
HEsp* g_phEsp;

View File

@ -14,10 +14,10 @@ class ConVar;
class Color;
class CachedEntity;
class HEsp : public IHack {
class ESP : public IHack {
public:
DECLARE_HACK_METHODS();
HEsp();
ESP();
void DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax);
void ProcessEntity(CachedEntity* ent);
void ProcessEntityPT(CachedEntity* ent);
@ -44,6 +44,6 @@ public:
//ConVar* v_bModelInfo;
};
extern HEsp* g_phEsp;
DECLARE_HACK_SINGLETON(ESP);
#endif /* HESP_H_ */

View File

@ -26,6 +26,8 @@
#include <cdll_int.h>
#include <igameevents.h>
DEFINE_HACK_SINGLETON(FollowBot);
unsigned long g_nTick = 0;
const char* FollowBot::GetName() {
@ -410,5 +412,3 @@ FollowBot::~FollowBot() {
}
void FollowBot::PaintTraverse(void*, unsigned int, bool, bool) {}
FollowBot* g_phFollowBot = 0;

View File

@ -66,6 +66,6 @@ public:
unsigned last_command_local;
};
extern FollowBot* g_phFollowBot;
DECLARE_HACK_SINGLETON(FollowBot)
#endif /* HPYROBOT_H_ */

View File

@ -1,10 +0,0 @@
/*
* HPowerupList.cpp
*
* Created on: Oct 10, 2016
* Author: nullifiedcat
*/

View File

@ -1,33 +0,0 @@
/*
* HPowerupList.h
*
* Created on: Oct 10, 2016
* Author: nullifiedcat
*/
#ifndef HPOWERUPLIST_H_
#define HPOWERUPLIST_H_
#include "IHack.h"
// TODO implement
/*class HPowerupList : public IHack {
public:
void Create();
void Destroy();
void CreateMove(void*, float, CUserCmd*);
void PaintTraverse(void*, unsigned int, bool, bool);
ConVar* v_bEnabled;
ConVar* v_iPosX;
ConVar* v_iPosY;
ConVar* v_bShowNames;
ConVar* v_bShowClass;
ConVar* v_bShowDistance;
// TODO
};
*/
#endif /* HPOWERUPLIST_H_ */

View File

@ -1,16 +0,0 @@
/*
* InfoSpam.cpp
*
* Created on: Nov 19, 2016
* Author: nullifiedcat
*/
#include "InfoSpam.h"
/*void InfoSpam::Create() {
}
bool InfoSpam::CreateMove(void*, float, CUserCmd*) { return true; }
void InfoSpam::PaintTraverse(void*, unsigned int, bool, bool) {}
void InfoSpam::Destroy() {}*/

View File

@ -1,25 +0,0 @@
/*
* InfoSpam.h
*
* Created on: Nov 19, 2016
* Author: nullifiedcat
*/
#ifndef HACKS_INFOSPAM_H_
#define HACKS_INFOSPAM_H_
#include "IHack.h"
// TODO
/*#include <vector>
void CC_ShowInfo(const CCommand& args);
class InfoSpam : public IHack {
public:
DECLARE_HACK();
ConVar* v_bEnabled;
ConCommand* c_ShowInfo;
};*/
#endif /* HACKS_INFOSPAM_H_ */

View File

@ -30,6 +30,8 @@
#include <inputsystem/iinputsystem.h>
#include <globalvars_base.h>
DEFINE_HACK_SINGLETON(Misc);
const char* Misc::GetName() {
return "MISC";
}
@ -275,11 +277,10 @@ void Misc::PaintTraverse(void*, unsigned int, bool, bool) {
AddSideString(draw::white, draw::black, "realtime: %f", interfaces::gvars->realtime);
AddSideString(draw::white, draw::black, "interval_per_tick: %f", interfaces::gvars->interval_per_tick);
AddSideString(draw::white, draw::black, "ambassador_can_headshot: %i", (interfaces::gvars->curtime - GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flLastFireTime)) > 0.95);
AddSideString(draw::white, draw::black, "WeaponMode: %i", GetWeaponMode(g_pLocalPlayer->entity));
//AddSideString(draw::white, draw::black, "VecPunchAngle: %f %f %f", pa.x, pa.y, pa.z);
//draw::DrawString(10, y, draw::white, draw::black, false, "VecPunchAngleVel: %f %f %f", pav.x, pav.y, pav.z);
//y += 14;
//AddCenterString(draw::font_handle, interfaces::input->GetAnalogValue(AnalogCode_t::MOUSE_X), interfaces::input->GetAnalogValue(AnalogCode_t::MOUSE_Y), draw::white, L"S\u0FD5");
}
}
Misc* g_phMisc = 0;

View File

@ -38,6 +38,6 @@ public:
ConCommand* c_DisconnectVAC;
};
extern Misc* g_phMisc;
DECLARE_HACK_SINGLETON(Misc);
#endif /* HACKS_MISC_H_ */

View File

@ -5,8 +5,6 @@
* Author: nullifiedcat
*/
#include "HTrigger.h"
#include "../interfaces.h"
#include "../drawing.h"
#include "../usercmd.h"
@ -28,8 +26,11 @@
#include <icliententity.h>
#include <client_class.h>
#include <tier1/convar.h>
#include "Trigger.h"
const char* HTrigger::GetName() {
DEFINE_HACK_SINGLETON(Triggerbot);
const char* Triggerbot::GetName() {
return "TRIGGER";
}
@ -37,7 +38,7 @@ Vector eye;
trace_t* enemy_trace;
trace::FilterDefault* filter;
HTrigger::HTrigger() {
Triggerbot::Triggerbot() {
filter = new trace::FilterDefault();
enemy_trace = new trace_t();
this->v_bBodyshot = CreateConVar("u_trigger_bodyshot", "1", "Enables bodyshotting when there is enough charge to oneshot enemy");
@ -50,7 +51,7 @@ HTrigger::HTrigger() {
this->v_bBuildings = CreateConVar("u_trigger_buildings", "1", "Trigger is activated at buildings");
}
bool HTrigger::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) {
bool Triggerbot::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) {
if (!this->v_bEnabled->GetBool()) return true;
if (g_pLocalPlayer->life_state) return true;
/*IClientEntity* local = interfaces::entityList->GetClientEntity(interfaces::engineClient->GetLocalPlayer());
@ -134,11 +135,9 @@ bool HTrigger::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) {
return true;
}
HTrigger::~HTrigger() {
Triggerbot::~Triggerbot() {
delete filter;
delete enemy_trace;
}
void HTrigger::PaintTraverse(void*, unsigned int, bool, bool) {};
HTrigger* g_phTrigger = 0;
void Triggerbot::PaintTraverse(void*, unsigned int, bool, bool) {};

View File

@ -12,11 +12,11 @@
class ConVar;
class HTrigger : public IHack {
class Triggerbot : public IHack {
public:
DECLARE_HACK_METHODS();
HTrigger();
~HTrigger();
Triggerbot();
~Triggerbot();
ConVar* v_bEnabled;
ConVar* v_bIgnoreCloak;
ConVar* v_bZoomedOnly;
@ -28,6 +28,6 @@ public:
ConVar* v_bIgnoreVaccinator;
};
extern HTrigger* g_phTrigger;
DECLARE_HACK_SINGLETON(Triggerbot);
#endif /* HTRIGGER_H_ */

View File

@ -416,10 +416,26 @@ weaponmode GetWeaponMode(IClientEntity* player) {
int weapon_handle = GetEntityValue<int>(player, eoffsets.hActiveWeapon);
if (weapon_handle == GetEntityValue<int>(player, eoffsets.hMyWeapons + sizeof(int) * 2)) return weaponmode::weapon_melee;
IClientEntity* weapon = interfaces::entityList->GetClientEntity(weapon_handle & 0xFFF);
if (!weapon) return weaponmode::weapon_invalid;
switch (weapon->GetClientClass()->m_ClassID) {
case ClassID::CTFLunchBox:
case ClassID::CTFLunchBox_Drink:
return weaponmode::weapon_consumable;
case ClassID::CTFRocketLauncher_DirectHit:
case ClassID::CTFRocketLauncher:
case ClassID::CTFGrenadeLauncher:
case ClassID::CTFCompoundBow:
case ClassID::CTFBat_Wood:
case ClassID::CTFBat_Giftwrap:
case ClassID::CTFFlareGun:
case ClassID::CTFFlareGun_Revenge:
case ClassID::CTFSyringeGun:
return weaponmode::weapon_projectile;
};
if (weapon_handle == GetEntityValue<int>(player, eoffsets.hMyWeapons + sizeof(int) * 3)) return weaponmode::weapon_pda;
if (GetEntityValue<int>(player, eoffsets.iClass) == tf_class::tf_medic) {
if (weapon_handle == GetEntityValue<int>(player, eoffsets.hMyWeapons + sizeof(int) * 1)) return weaponmode::weapon_medigun;
}
return weaponmode::weapon_hitscan;
}
@ -429,22 +445,22 @@ bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc, float& gr
bool rarc;
float rgrav = 0.5f;
switch (weapon->GetClientClass()->m_ClassID) {
case weapons::WP_DIRECT_HIT:
case ClassID::CTFRocketLauncher_DirectHit:
rspeed = 1980.0f;
rarc = false;
//rgrav = 0.0f;
break;
case weapons::WP_ROCKET_LAUNCHER:
case ClassID::CTFRocketLauncher:
rspeed = 1100.0f;
rarc = false;
//rgrav = 0.0f;
break;
case weapons::WP_GRENADE_LAUNCHER:
case ClassID::CTFGrenadeLauncher:
rspeed = 1200.0f; // TODO Loch-N-Load: 1500u
rarc = true;
//rgrav = 0.5f;
break;
case weapons::WP_HUNTSMAN: {
case ClassID::CTFCompoundBow: {
// TODO curtime
float begincharge = GetEntityValue<float>(weapon, eoffsets.flChargeBeginTime);
float charge = 0;
@ -456,12 +472,12 @@ bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc, float& gr
rspeed = 1800 + 800 * charge;
rarc = true;
} break;
case weapons::WP_SANDMAN:
case ClassID::CTFBat_Wood:
//rgrav = 1.0f;
rspeed = 3000.0f;
rarc = true;
break;
case weapons::WP_FLAREGUN:
case ClassID::CTFFlareGun:
//rgrav = 1.0f;
rspeed = 2000.0f;
rarc = true;