CC_Prop_Dynamic_Create
0x007e74e0 · 1936 bytes · __cdecl
_Z22CC_Prop_Dynamic_CreateRK8CCommand
Decompiled
undefined (1 param)
/* CC_Prop_Dynamic_Create(CCommand const&) */
void CC_Prop_Dynamic_Create(CCommand *param_1)
{
int *piVar1;
float fVar2;
float fVar3;
float fVar4;
bool bVar5;
short sVar6;
CBasePlayer *this;
int iVar7;
CBaseEntity *pCVar8;
undefined1 *puVar9;
int in_GS_OFFSET;
longdouble lVar10;
float local_500;
float local_4fc;
float local_4f8;
float local_4f4;
float local_4f0;
float local_4ec;
float local_4e8;
float local_4e4;
float local_4e0;
CTraceFilterSimple local_4dc [16];
float local_4cc;
float local_4c8;
float local_4c4;
float local_4bc;
float local_4b8;
float local_4b4;
float local_4ac;
float local_4a8;
float local_4a4;
undefined4 local_49c;
undefined4 local_498;
undefined4 local_494;
undefined4 local_48c;
undefined1 local_488;
undefined1 local_487;
Vector local_474 [12];
Vector local_468 [12];
float local_45c;
float local_458;
float local_454;
float local_448;
char local_420 [512];
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
puVar9 = &stack0xfffffab4;
if (*(int *)param_1 == 2) {
this = (CBasePlayer *)UTIL_GetCommandClient();
CBasePlayer::EyeVectors(this,(Vector *)&local_500,(Vector *)0x0,(Vector *)0x0);
(**(code **)(*(int *)this + 0x234))();
fVar4 = local_4e0;
fVar3 = local_4e4;
fVar2 = local_4e8;
(**(code **)(*(int *)this + 0x234))();
local_48c = 0;
local_488 = 1;
local_4cc = local_4f4;
local_4c8 = local_4f0;
local_4b8 = (local_4fc * 56755.84 - local_4f0) + fVar3;
local_4c4 = local_4ec;
local_4b4 = (local_4f8 * 56755.84 - local_4ec) + fVar4;
local_4bc = (local_500 * 56755.84 - local_4f4) + fVar2;
local_494 = 0;
local_498 = 0;
local_49c = 0;
local_487 = local_4b8 * local_4b8 + local_4b4 * local_4b4 + local_4bc * local_4bc != 0.0;
local_4a4 = 0.0;
local_4a8 = 0.0;
local_4ac = 0.0;
CTraceFilterSimple::CTraceFilterSimple
(local_4dc,(IHandleEntity *)this,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_474,local_468,0xff,0,0,true,-1.0);
}
piVar1 = mdlcache;
puVar9 = &stack0xfffffaac;
if (local_448 != 1.0) {
(**(code **)(*mdlcache + 0x68))();
/* try { // try from 007e77c7 to 007e7c4d has its CatchHandler @ 007e7c80 */
V_snprintf(local_420,0x200,"models/%s");
V_DefaultExtension(local_420,".mdl",0x200);
sVar6 = (**(code **)(*mdlcache + 0x18))();
if (sVar6 == -1) {
(**(code **)(*piVar1 + 0x6c))();
puVar9 = &stack0xfffffaac;
}
else {
bVar5 = (bool)CBaseEntity::IsPrecacheAllowed();
CBaseEntity::SetAllowPrecache(true);
(**(code **)(*mdlcache + 0x30))();
local_4e0 = -local_458;
local_4f4 = 1.0;
local_4f0 = 0.0;
local_4ec = 0.0;
local_4e8 = 0.0;
local_4e4 = local_454;
lVar10 = (longdouble)VectorNormalize((Vector *)&local_4e8);
if ((float)lVar10 < 0.001) {
local_4f4 = 0.0;
local_4e8 = local_458;
local_4f0 = 0.0;
local_4e4 = -local_45c;
local_4ec = 1.0;
local_4e0 = 0.0;
VectorNormalize((Vector *)&local_4e8);
}
local_4f4 = local_454 * local_4e4 - local_458 * local_4e0;
local_4f0 = local_4e0 * local_45c - local_454 * local_4e8;
local_4ec = local_458 * local_4e8 - local_4e4 * local_45c;
VectorNormalize((Vector *)&local_4f4);
local_4cc = local_4f4;
local_4bc = local_4f0;
local_4ac = local_4ec;
local_4c8 = local_4e8;
local_4b8 = local_4e4;
local_4a8 = local_4e0;
local_4c4 = local_45c;
local_4b4 = local_458;
local_4a4 = local_454;
MatrixToAngles((VMatrix *)&local_4cc,(QAngle *)local_4dc);
iVar7 = CreateEntityByName("dynamic_prop",-1,true);
if ((iVar7 != 0) && (pCVar8 = (CBaseEntity *)__dynamic_cast(), pCVar8 != (CBaseEntity *)0x0)
) {
V_snprintf(local_220,0x200,"%.10f %.10f %.10f");
(**(code **)(*(int *)pCVar8 + 0x84))();
V_snprintf(local_220,0x200,"%.10f %.10f %.10f");
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x84))();
(**(code **)(*(int *)pCVar8 + 0x6c))();
DispatchSpawn(pCVar8,true);
(**(code **)(*(int *)pCVar8 + 0x94))();
}
CBaseEntity::SetAllowPrecache(bVar5);
(**(code **)(*piVar1 + 0x6c))();
puVar9 = &stack0xfffffaac;
}
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined1 **)(puVar9 + -4) = &LAB_007e7c80;
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.