CBreakableProp::BreakablePropTouch
0x007e7140 · 767 bytes · __thiscall
_ZN14CBreakableProp18BreakablePropTouchEP11CBaseEntity
Decompiled
undefined (2 params)
/* CBreakableProp::BreakablePropTouch(CBaseEntity*) */
void __thiscall CBreakableProp::BreakablePropTouch(CBreakableProp *this,CBaseEntity *param_1)
{
float fVar1;
float fVar2;
uint uVar3;
int iVar4;
code *pcVar5;
CBreakableProp *pCVar6;
undefined4 *puVar7;
int *piVar8;
undefined1 local_94 [12];
float local_88;
float local_84;
float local_80;
float local_7c;
float local_78;
float local_74;
piVar8 = (int *)&stack0xffffff44;
uVar3 = *(uint *)(this + 0x148);
if ((uVar3 & 0x10) != 0) {
(**(code **)(*(int *)param_1 + 600))();
piVar8 = (int *)&stack0xffffff40;
fVar1 = SQRT(local_74 * local_74 + local_78 * local_78 + local_7c * local_7c) * 0.01;
if ((float)*(int *)(this + 0x100) <= fVar1) {
if (this[0x105] != (CBreakableProp)0x2) {
(**(code **)(*(int *)this + 0x224))();
this[0x105] = (CBreakableProp)0x2;
}
pcVar5 = *(code **)(*(int *)this + 0x124);
CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c,param_1,param_1,fVar1,1,0);
(*pcVar5)();
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)&local_7c,param_1,param_1,fVar1 * 0.25,4,0);
if ((((byte)this[0x14d] & 8) != 0) &&
(CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this), ((byte)this[0x14d] & 8) != 0)) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
local_88 = *(float *)(param_1 + 0x2e0) - *(float *)(this + 0x2e0);
local_84 = *(float *)(param_1 + 0x2e4) - *(float *)(this + 0x2e4);
local_80 = *(float *)(param_1 + 0x2e8) - *(float *)(this + 0x2e8);
CalculateMeleeDamageForce
((CTakeDamageInfo *)&local_7c,(Vector *)&local_88,(Vector *)(this + 0x2e0),1.0);
CBaseEntity::TakeDamage(param_1,(CTakeDamageInfo *)&local_7c);
}
uVar3 = *(uint *)(this + 0x148);
}
if ((uVar3 & 0x20) != 0) {
*piVar8 = (int)param_1;
piVar8[-1] = 0x7e733b;
pCVar6 = (CBreakableProp *)CBaseEntity::GetGroundEntity((CBaseEntity *)*piVar8);
if (pCVar6 == this) {
if (param_1 == (CBaseEntity *)0x0) {
pcVar5 = *(code **)(this + 0x1c);
*(undefined4 *)(this + 0x1464) = 0xffffffff;
}
else {
iVar4 = *(int *)param_1;
*piVar8 = (int)param_1;
pcVar5 = *(code **)(iVar4 + 0xc);
piVar8[-1] = 0x7e7355;
puVar7 = (undefined4 *)(*pcVar5)();
pcVar5 = *(code **)(this + 0x1c);
*(undefined4 *)(this + 0x1464) = *puVar7;
}
if ((pcVar5 != BreakThink) || (*(int *)(this + 0x20) != 0)) {
piVar8[1] = (int)pCVar6;
*piVar8 = (int)local_94;
piVar8[5] = 0;
piVar8[4] = 0;
piVar8[2] = (int)BreakThink;
piVar8[3] = 0;
piVar8[-1] = 0x7e739c;
CBaseEntity::ThinkSet((_func_void *)*piVar8,(float)piVar8[1],(char *)piVar8[2]);
piVar8[2] = 0;
fVar1 = *(float *)(this + 0x1460);
fVar2 = *(float *)(gpGlobals + 0xc);
*piVar8 = (int)pCVar6;
piVar8[1] = (int)(fVar1 + fVar2);
piVar8[-1] = 0x7e73c7;
CBaseEntity::SetNextThink((CBaseEntity *)*piVar8,(float)piVar8[1],(char *)piVar8[2]);
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.