CBreakableSurface::SurfaceTouch
0x006b9130 · 1105 bytes · __thiscall
_ZN17CBreakableSurface12SurfaceTouchEP11CBaseEntity
Decompiled
undefined (2 params)
/* CBreakableSurface::SurfaceTouch(CBaseEntity*) */
void __thiscall CBreakableSurface::SurfaceTouch(CBreakableSurface *this,CBaseEntity *param_1)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
int iVar6;
float fVar7;
float fVar8;
CBaseEntity *this_00;
CBaseEntity *pCVar9;
Vector *pVVar10;
float local_5c;
float local_58;
float local_54;
float local_50;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
if ((*(int *)(this + 0x528) == 1) &&
((**(code **)(*(int *)param_1 + 0x25c))(param_1,&local_28,0),
SQRT(local_28 * local_28 + local_24 * local_24 + local_20 * local_20) < 500.0)) {
return;
}
CCollisionProperty::CollisionAABBToWorldAABB
((CCollisionProperty *)(param_1 + 0x194),(Vector *)(param_1 + 0x19c),
(Vector *)(param_1 + 0x1a8),(Vector *)&local_4c,(Vector *)&local_40);
fVar7 = (local_3c - *(float *)(this + 0x51c)) * *(float *)(this + 0x510) +
(local_40 - *(float *)(this + 0x518)) * *(float *)(this + 0x50c) +
(local_38 - *(float *)(this + 0x520)) * *(float *)(this + 0x514);
local_34 = *(float *)(this + 0x50c) * fVar7 + local_40;
local_30 = *(float *)(this + 0x510) * fVar7 + local_3c;
local_2c = fVar7 * *(float *)(this + 0x514) + local_38;
PanePos(this,(Vector *)&local_34,&local_5c,&local_58);
fVar7 = (local_48 - *(float *)(this + 0x51c)) * *(float *)(this + 0x510) +
(local_4c - *(float *)(this + 0x518)) * *(float *)(this + 0x50c) +
(local_44 - *(float *)(this + 0x520)) * *(float *)(this + 0x514);
local_34 = *(float *)(this + 0x50c) * fVar7 + local_4c;
local_30 = *(float *)(this + 0x510) * fVar7 + local_48;
local_2c = fVar7 * *(float *)(this + 0x514) + local_44;
PanePos(this,(Vector *)&local_34,&local_54,&local_50);
fVar7 = local_5c;
if (local_54 <= local_5c) {
fVar7 = local_54;
}
fVar8 = 0.0;
if ((0.0 <= fVar7) && (fVar8 = local_54, local_5c <= local_54)) {
fVar8 = local_5c;
}
if (local_5c <= local_54) {
local_5c = local_54;
}
iVar1 = (int)ROUND(fVar8) - (uint)(fVar8 < (float)(int)ROUND(fVar8));
fVar7 = (float)*(int *)(this + 0x4fc);
if (local_5c <= (float)*(int *)(this + 0x4fc)) {
fVar7 = local_5c;
}
iVar2 = (int)ROUND(fVar7) + (uint)((float)(int)ROUND(fVar7) < fVar7);
fVar7 = local_50;
if (local_58 < local_50) {
fVar7 = local_58;
}
fVar8 = 0.0;
if ((0.0 <= fVar7) && (fVar8 = local_50, local_58 <= local_50)) {
fVar8 = local_58;
}
if (local_58 <= local_50) {
local_58 = local_50;
}
pCVar9 = (CBaseEntity *)&local_28;
iVar5 = (int)ROUND(fVar8) - (uint)(fVar8 < (float)(int)ROUND(fVar8));
fVar7 = (float)*(int *)(this + 0x500);
if (local_58 <= (float)*(int *)(this + 0x500)) {
fVar7 = local_58;
}
iVar3 = (int)ROUND(fVar7) + (uint)((float)(int)ROUND(fVar7) < fVar7);
pVVar10 = (Vector *)0x0;
this_00 = param_1;
(**(code **)(*(int *)param_1 + 0x25c))();
local_28 = local_28 * 5.0;
local_24 = local_24 * 5.0;
local_20 = local_20 * 5.0;
if (this[0x524] == (CBreakableSurface)0x0) {
Die((CBreakableSurface *)this_00,pCVar9,pVVar10);
}
pVVar10 = (Vector *)(param_1 + 0x39c);
if (iVar5 < iVar3) {
do {
iVar4 = (**(code **)(*random_valve + 8))(random_valve,0,1);
if (iVar4 != 0) {
ShatterPane(this,iVar1 + -1,iVar5,(Vector *)&local_28,pVVar10);
}
iVar4 = iVar1;
if (iVar1 < iVar2) {
do {
iVar6 = iVar4 + 1;
ShatterPane(this,iVar4,iVar5,(Vector *)&local_28,pVVar10);
iVar4 = iVar6;
} while (iVar6 != iVar2);
}
iVar4 = (**(code **)(*random_valve + 8))(random_valve,0,1);
if (iVar4 != 0) {
ShatterPane(this,iVar2 + 1,iVar5,(Vector *)&local_28,pVVar10);
}
iVar5 = iVar5 + 1;
} while (iVar5 != iVar3);
}
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.