CRagdollProp::OnPhysGunDrop
0x00797380 · 739 bytes · __thiscall
_ZN12CRagdollProp13OnPhysGunDropEP11CBasePlayer13PhysGunDrop_t
Decompiled
undefined (3 params)
/* CRagdollProp::OnPhysGunDrop(CBasePlayer*, PhysGunDrop_t) */
void __thiscall CRagdollProp::OnPhysGunDrop(CRagdollProp *this,int *param_1,int param_3)
{
int *piVar1;
int iVar2;
char cVar3;
ushort uVar4;
undefined4 *puVar5;
CRagdollProp *pCVar6;
int iVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
undefined1 local_44 [16];
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
if (param_1 == (int *)0x0) {
*(undefined4 *)(this + 0x1eb8) = 0xffffffff;
}
else {
puVar5 = (undefined4 *)(**(code **)(*param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x1eb8) = *puVar5;
}
*(undefined4 *)(this + 0x1ebc) = *(undefined4 *)(gpGlobals + 0xc);
cVar3 = HasPhysgunInteraction(this,"onpickup","boogie");
if (cVar3 != '\0') {
CRagdollBoogie::Create((CBaseEntity *)this,150.0,*(float *)(gpGlobals + 0xc),3.0,0x10000);
}
if (((byte)this[0x149] & 0x10) == 0) {
iVar7 = *(int *)(this + 0x234);
}
else {
CRagdollLRURetirement::MoveToTopOfLRU((CRagdollLRURetirement *)s_RagdollLRU,this,1);
iVar7 = *(int *)(this + 0x234);
}
if (iVar7 == 3) {
CBaseEntity::ThinkSet((_func_void *)local_44,(float)this,(char *)SetDebrisThink);
}
if (param_3 == 3) {
cVar3 = HasPhysgunInteraction(this,"onlaunch","spin_zaxis");
if ((cVar3 != '\0') && (0 < *(int *)(this + 0x13f8))) {
fVar8 = 0.0;
fVar10 = 0.0;
fVar9 = 0.0;
iVar7 = 0;
pCVar6 = this + 0x1410;
do {
piVar1 = *(int **)pCVar6;
iVar7 = iVar7 + 1;
pCVar6 = pCVar6 + 0x54;
(**(code **)(*piVar1 + 0xc4))(piVar1,&local_28,0);
iVar2 = *(int *)(this + 0x13f8);
fVar8 = fVar8 + local_28;
fVar10 = fVar10 + local_24;
fVar9 = fVar9 + local_20;
} while (iVar7 < iVar2);
fVar11 = 1.0 / (float)iVar2;
if (0 < iVar2) {
iVar7 = 0;
pCVar6 = this + 0x1410;
do {
iVar7 = iVar7 + 1;
(**(code **)(**(int **)pCVar6 + 0xc4))(*(int **)pCVar6,&local_34,0);
local_20 = 0.0;
local_34 = local_34 - fVar8 * fVar11;
local_30 = local_30 - fVar10 * fVar11;
local_24 = local_34 * 100.0;
local_28 = -local_30 * 100.0;
local_2c = local_2c - fVar11 * fVar9;
(**(code **)(**(int **)pCVar6 + 0xd8))(*(int **)pCVar6,&local_28,0);
pCVar6 = pCVar6 + 0x54;
} while (iVar7 < *(int *)(this + 0x13f8));
}
}
piVar1 = *(int **)(this + 0x238);
uVar4 = (**(code **)(*piVar1 + 0x50))(piVar1);
(**(code **)(*piVar1 + 0x4c))(piVar1,uVar4 | 0x100);
this[0x1ead] = (CRagdollProp)0x1;
return;
}
return;
}
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.