Finish RayTrace plugin
This commit is contained in:
parent
5ccf6494e1
commit
cae6b08ffe
7 changed files with 115 additions and 56 deletions
|
|
@ -107,7 +107,7 @@ namespace RayTracePlugin
|
|||
void *IPlugin::OnMetamodQuery(const char *iface, int *ret) {
|
||||
if (strcmp(iface, RAYTRACE_INTERFACE_VERSION) == 0) {
|
||||
*ret = META_IFACE_OK;
|
||||
FP_INFO("CRayTraceInterface001 accessed.");
|
||||
FP_INFO("{} accessed.", RAYTRACE_INTERFACE_VERSION);
|
||||
return &RayTrace::g_CRayTrace;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace RayTracePlugin::RayTrace
|
||||
{
|
||||
CRayTrace g_CRayTrace;
|
||||
|
||||
using TraceShapeFn = bool(*)(void* pThis,
|
||||
Ray_t& ray,
|
||||
Vector& start,
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ namespace RayTracePlugin::RayTrace
|
|||
: CTraceFilter(static_cast<CEntityInstance*>(entityToIgnore),
|
||||
entityToIgnore ? entityToIgnore->m_hOwnerEntity.Get() : nullptr,
|
||||
entityToIgnore ? entityToIgnore->m_pCollision()->m_collisionAttribute().m_nHierarchyId() : static_cast<uint16>(0xFFFFFFFF),
|
||||
0x2c3011,
|
||||
static_cast<uint64_t>(MASK_SHOT_PHYSICS),
|
||||
COLLISION_GROUP_DEFAULT, true)
|
||||
{
|
||||
}
|
||||
|
||||
CTraceFilterEx() : CTraceFilter(0x2c3011, COLLISION_GROUP_DEFAULT, true)
|
||||
CTraceFilterEx() : CTraceFilter(static_cast<uint64_t>(MASK_SHOT_PHYSICS), COLLISION_GROUP_DEFAULT, true)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
|
@ -78,5 +78,5 @@ namespace RayTracePlugin::RayTrace
|
|||
}
|
||||
};
|
||||
|
||||
inline CRayTrace g_CRayTrace;
|
||||
extern CRayTrace g_CRayTrace;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ namespace RayTracePlugin::Listeners {
|
|||
void SourceHooks::Hook_GameFrame(bool simulating, bool bFirstTick, bool bLastTick)
|
||||
{
|
||||
Tasks::Tick(simulating);
|
||||
if (!shared::getGlobalVars())
|
||||
return;
|
||||
}
|
||||
|
||||
void SourceHooks::Hook_StartupServer(const GameSessionConfiguration_t& config,
|
||||
|
|
|
|||
|
|
@ -30,37 +30,6 @@ RayTracePlugin
|
|||
|
||||
SCHEMA_FIELD(float32, m_flShadowStrength)
|
||||
|
||||
void SetModel(const char* model)
|
||||
{
|
||||
using SetModel_t = void (*)(CBaseModelEntity*, const char*);
|
||||
static SetModel_t s_SetModel = nullptr;
|
||||
|
||||
if (!s_SetModel)
|
||||
{
|
||||
SetModel_t addr =
|
||||
DynLibUtils::CModule(shared::g_pServer)
|
||||
.FindPattern(shared::g_pGameConfig->GetSignature("CBaseModelEntity_SetModel"))
|
||||
.RCast<SetModel_t>();
|
||||
|
||||
if (!addr) return;
|
||||
s_SetModel = addr;
|
||||
}
|
||||
|
||||
s_SetModel(this, model);
|
||||
}
|
||||
|
||||
void SetBodyGroup(std::string name, int value)
|
||||
{
|
||||
char bodygroupStr[64];
|
||||
g_SMAPI->Format(bodygroupStr, sizeof(bodygroupStr), "%s,%i", name.c_str(), value);
|
||||
this->AcceptInput(
|
||||
"SetBodyGroup",
|
||||
this,
|
||||
this,
|
||||
bodygroupStr
|
||||
);
|
||||
}
|
||||
|
||||
CUtlSymbolLarge GetModelName()
|
||||
{
|
||||
if (m_CBodyComponent == nullptr) return CUtlSymbolLarge();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue