r5sdk/r5dev/game/shared/r1/weapon_bolt.h
Kawe Mazidjatari edc52ad669 IDetour: remove extraneous pointer assignments
Originally, we store the search results in a CMemory instance which we then assign to the actual function pointer. CMemory is just a pointer class; we can assign the results directly to the actual function pointer. This commit reduces a lot of code verbosity, and also reduced roughly 2KiB worth of static pointers in the resulting executable. This commit also officially deprecates the support for any GameDLL's below S3 (Season 3), since it makes more sense to port the assets from earlier/later games back to the version this SDK supports.
2024-04-05 17:19:32 +02:00

39 lines
1.3 KiB
C++

#ifndef GAME_WEAPON_BOLT_H
#define GAME_WEAPON_BOLT_H
#include <game/shared/shared_classnames.h>
#ifndef CLIENT_DLL
#include <game/server/baseentity.h>
#include <game/server/player.h>
#else
#include <game/client/c_baseentity.h>
#include <game/client/c_baseplayer.h>
#endif
CBaseEntity* CreateWeaponBolt(Vector3D* origin, Vector3D* end, __int64 unused, float scale, CPlayer* unkEnt,
int a6, int modelindex, int a8, unsigned __int8 a9, unsigned int a10, CBaseEntity* weaponEnt);
inline CBaseEntity*(*v_CreateWeaponBolt)(
Vector3D* origin, Vector3D* end, __int64 unused, float scale, CPlayer* player,
int a6, int modelindex, int a8, unsigned __int8 a9, unsigned int a10, CBaseEntity* weapon);
///////////////////////////////////////////////////////////////////////////////
class V_Weapon_Bolt : public IDetour
{
virtual void GetAdr(void) const
{
LogFunAdr("CreateWeaponBolt", v_CreateWeaponBolt);
}
virtual void GetFun(void) const { }
virtual void GetVar(void) const
{
g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC 70").GetPtr(v_CreateWeaponBolt);
}
virtual void GetCon(void) const { }
virtual void Detour(const bool bAttach) const;
};
///////////////////////////////////////////////////////////////////////////////
#endif // GAME_WEAPON_BOLT_H