CPlayerPickupController::Init
0x004ed1c0 · 437 bytes · __thiscall
_ZN23CPlayerPickupController4InitEP11CBasePlayerP11CBaseEntity
Decompiled
undefined (3 params)
/* CPlayerPickupController::Init(CBasePlayer*, CBaseEntity*) */
void __thiscall
CPlayerPickupController::Init
(CPlayerPickupController *this,CBasePlayer *param_1,CBaseEntity *param_2)
{
undefined4 uVar1;
CBaseEdict *this_00;
char cVar2;
int iVar3;
int *piVar4;
int *piVar5;
undefined *puVar6;
uint uVar7;
iVar3 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_1);
if (iVar3 != 0) {
piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_1);
cVar2 = (**(code **)(*piVar4 + 0x428))(piVar4,0);
if (cVar2 == '\0') {
Shutdown(this,false);
return;
}
}
if (*(int *)(param_2 + 0x234) == 1) {
CBaseEntity::SetCollisionGroup(param_2,3);
}
(**(code **)(*(int *)this + 0x98))(this,param_1,0xffffffff);
*(CBasePlayer **)(this + 0x24c4) = param_1;
this[0x4a1] = (CPlayerPickupController)0x1;
*(undefined4 *)(this + 0x49c) = 0x3f5db3d7;
uVar1 = *(undefined4 *)(param_2 + 0x238);
Pickup_OnPhysGunPickup(param_2,param_1,0);
CGrabController::AttachEntity
((CBasePlayer *)(this + 0x440),(CBaseEntity *)param_1,(IPhysicsObject *)param_2,
SUB41(uVar1,0),(Vector *)0x0,true);
piVar4 = *(int **)(this + 0x24c4);
uVar7 = piVar4[0x69f] | 1;
if (piVar4[0x69f] != uVar7) {
(**(code **)(piVar4[0x690] + 4))(piVar4 + 0x690,piVar4 + 0x69f);
piVar4[0x69f] = uVar7;
piVar4 = *(int **)(this + 0x24c4);
}
uVar7 = piVar4[0x745];
if ((((uVar7 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar7 >> 0xc)) ||
(this != *(CPlayerPickupController **)(puVar6 + 4))) {
if ((char)piVar4[0x1b] == '\0') {
this_00 = (CBaseEdict *)piVar4[0xc];
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
*(byte *)(piVar4 + 0x1c) = *(byte *)(piVar4 + 0x1c) | 1;
}
piVar5 = (int *)(**(code **)(*(int *)this + 0xc))(this);
piVar4[0x745] = *piVar5;
}
/* WARNING: Could not recover jumptable at 0x004ed33b. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*piVar4 + 0x76c))();
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.