CBreakableProp::OnAttemptPhysGunPickup
0x007e8620 · 1129 bytes · __thiscall
_ZN14CBreakableProp22OnAttemptPhysGunPickupEP11CBasePlayer15PhysGunPickup_t
Decompiled
undefined (3 params)
/* CBreakableProp::OnAttemptPhysGunPickup(CBasePlayer*, PhysGunPickup_t) */
undefined4 __thiscall
CBreakableProp::OnAttemptPhysGunPickup(CBreakableProp *this,undefined4 param_1,int param_3)
{
CBreakableProp CVar1;
CBaseEdict *pCVar2;
char cVar3;
int iVar4;
float fVar5;
undefined1 local_14 [8];
CVar1 = this[0x14af];
if (CVar1 == (CBreakableProp)0x2) {
return 1;
}
if (CVar1 != (CBreakableProp)0x5) {
if (CVar1 == (CBreakableProp)0x0) {
iVar4 = (**(code **)(*(int *)this + 0x340))(this,0x18c);
CBaseAnimating::ResetSequence((CBaseAnimating *)this,iVar4);
if (*(float *)(this + 0x468) != 0.0) {
if (this[0x6c] == (CBreakableProp)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CBreakableProp)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x468) = 0;
}
CBaseAnimating::ResetClientsideFrame((CBaseAnimating *)this);
this[0x14af] = (CBreakableProp)0x1;
return 0;
}
if (CVar1 == (CBreakableProp)0x3) {
if (param_3 == 1) {
return 0;
}
iVar4 = (**(code **)(*(int *)this + 0x340))(this,0x18e);
if (iVar4 == -1) {
iVar4 = (**(code **)(*(int *)this + 0x340))(this,0x18d);
this[0x14af] = (CBreakableProp)0x4;
COutputEvent::FireOutput
((COutputEvent *)(this + 0x14e0),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
else {
this[0x14af] = (CBreakableProp)0x6;
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)AnimateThink);
COutputEvent::FireOutput
((COutputEvent *)(this + 0x14c8),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
CBaseAnimating::ResetSequence((CBaseAnimating *)this,iVar4);
if (*(float *)(this + 0x468) != 1.0) {
if (this[0x6c] == (CBreakableProp)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CBreakableProp)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x468) = 0x3f800000;
}
CBaseAnimating::ResetClientsideFrame((CBaseAnimating *)this);
CVar1 = this[0x14af];
}
if (1 < (byte)((char)CVar1 - 6U)) {
if (CVar1 == (CBreakableProp)0x4) {
if (param_3 != 1) {
CBaseAnimating::StudioFrameAdvanceManual
((CBaseAnimating *)this,*(float *)(gpGlobals + 0x10));
(**(code **)(*(int *)this + 0x364))(this,this);
cVar3 = (**(code **)(*(int *)this + 0x338))(this);
if (cVar3 != '\0') {
iVar4 = (**(code **)(*(int *)this + 0x340))(this,399);
if (iVar4 == -1) {
this[0x14af] = (CBreakableProp)0x5;
COutputEvent::FireOutput
((COutputEvent *)(this + 0x1510),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0)
;
}
else {
this[0x14af] = (CBreakableProp)0x7;
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)AnimateThink);
CBaseAnimating::ResetSequence((CBaseAnimating *)this,iVar4);
if (*(float *)(this + 0x468) != 1.0) {
if (this[0x6c] == (CBreakableProp)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CBreakableProp)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x468) = 0x3f800000;
}
CBaseAnimating::ResetClientsideFrame((CBaseAnimating *)this);
COutputEvent::FireOutput
((COutputEvent *)(this + 0x14f8),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0)
;
}
}
}
}
else {
fVar5 = 0.5;
if (param_3 == 0) {
fVar5 = *(float *)(gpGlobals + 0x10);
}
CBaseAnimating::StudioFrameAdvanceManual((CBaseAnimating *)this,fVar5);
CBaseAnimating::ResetClientsideFrame((CBaseAnimating *)this);
(**(code **)(*(int *)this + 0x364))(this,this);
cVar3 = (**(code **)(*(int *)this + 0x338))(this);
if (cVar3 != '\0') {
if (*(float *)(this + 0x468) != 1.0) {
if (this[0x6c] == (CBreakableProp)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CBreakableProp)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x468) = 0x3f800000;
}
this[0x14af] = (CBreakableProp)0x2;
COutputEvent::FireOutput
((COutputEvent *)(this + 0x14b0),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
return 0;
}
}
}
}
return 0;
}
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.