Skip to content

Commit

Permalink
cleanup + DEBUG_RIOT_SHIELD support
Browse files Browse the repository at this point in the history
  • Loading branch information
L3D451R7 committed Dec 3, 2024
1 parent 0b3802e commit 63a9bb7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
29 changes: 12 additions & 17 deletions src/Components/Modules/Bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,17 @@ namespace Components
std::memcpy(CalcRicochetSave, result, sizeof(float[3]));
}

int Bullet::Bullet_Fire_Stub(Game::gentity_s* attacker, [[maybe_unused]] float spread, Game::weaponParms* wp, Game::gentity_s* weaponEnt, Game::PlayerHandIndex hand, int gameTime)
int Bullet::Bullet_Fire(Game::gentity_s* attacker,
float spread,
Game::weaponParms* wpParms,
Game::gentity_s* weaponEnt,
int unkBool,
int gameTime)
{
Game::AntilagClientStore antiLag_Backup;
AntiLag::G_AntiLagRewindClientPos(attacker, gameTime, &antiLag_Backup);

#ifdef DEBUG_RIOT_SHIELD
float tmp[3];

Game::G_DebugStar(ContactPointSave, ColorYellow);
Expand All @@ -97,20 +106,8 @@ namespace Components
Game::G_DebugLineWithDuration(VCSave, tmp, ColorOrange, 1, 100);
Game::G_DebugStar(tmp, ColorBlue);

// Set the spread to 0 when drawing
return Game::Bullet_Fire(attacker, 0.0f, wp, weaponEnt, hand, gameTime);
}

int Bullet::Bullet_Fire(Game::gentity_s* attacker,
float spread,
Game::weaponParms* wpParms,
Game::gentity_s* weaponEnt,
int unkBool,
int gameTime)
{
Game::AntilagClientStore antiLag_Backup;
AntiLag::G_AntiLagRewindClientPos(attacker, gameTime, &antiLag_Backup);

spread = 0;
#endif
uint32_t perks[2] = { 0,0 };

if (attacker->client) {
Expand Down Expand Up @@ -228,8 +225,6 @@ namespace Components
Utils::Hook(0x5D5BBA, CalcRicochet_Stub, HOOK_CALL).install()->quick();

Utils::Hook(0x5D5BD7, _VectorMA_Stub, HOOK_CALL).install()->quick();

Utils::Hook(0x5D5C0B, Bullet_Fire_Stub, HOOK_CALL).install()->quick();
#endif
}
}
5 changes: 1 addition & 4 deletions src/Components/Modules/Bullet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ namespace Components
class Bullet : public Component
{
public:
static int Bullet_Fire(Game::gentity_s* attacker, float spread, Game::weaponParms* weaponParms, Game::gentity_s* weaponEnt, int extrapolate_or_smth, int gameTime);

Bullet();

private:
Expand All @@ -26,14 +24,13 @@ namespace Components
static float BG_GetSurfacePenetrationDepthStub(const Game::WeaponDef* weapDef, int surfaceType);

static void BG_srand_Hk(unsigned int* pHoldrand);
static int Bullet_Fire(Game::gentity_s* attacker, float spread, Game::weaponParms* weaponParms, Game::gentity_s* weaponEnt, int extrapolate_or_smth, int gameTime);

static void BulletRicochet_Save(const float* contactPoint);
static void BulletRicochet_Stub();

static void CalcRicochet_Stub(const float* incoming, const float* normal, float* result);

static void _VectorMA_Stub(float* va, float scale, float* vb, float* vc);

static int Bullet_Fire_Stub(Game::gentity_s* attacker, float spread, Game::weaponParms* wp, Game::gentity_s* weaponEnt, Game::PlayerHandIndex hand, int gameTime);
};
}

0 comments on commit 63a9bb7

Please sign in to comment.