CTriggerPush::Touch
0x00b194a0 · 1229 bytes · __thiscall
_ZN12CTriggerPush5TouchEP11CBaseEntity
Decompiled
undefined (2 params)
/* CTriggerPush::Touch(CBaseEntity*) */
void __thiscall CTriggerPush::Touch(CTriggerPush *this,CBaseEntity *param_1)
{
CBaseEntity CVar1;
int *piVar2;
char cVar3;
int iVar4;
int iVar5;
longdouble lVar6;
float fVar7;
float fVar8;
float fVar9;
float local_1034;
float local_1030;
float local_102c;
float local_1028;
float local_1024;
float local_1020;
float local_101c [1027];
cVar3 = IsPushable(this,param_1);
if ((cVar3 != '\0') && (this[0x578] == (CTriggerPush)0x0)) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
VectorRotate((float *)(this + 0x56c),(matrix3x4_t *)(this + 0x28c),&local_1034);
if ((*(uint *)(this + 0x148) & 0x80) != 0) {
local_101c[2] = *(float *)(this + 0x580);
local_101c[0] = local_1034 * local_101c[2];
local_101c[1] = local_1030 * local_101c[2];
local_101c[2] = local_101c[2] * local_102c;
CBaseEntity::ApplyAbsVelocityImpulse(param_1,(Vector *)local_101c);
if (0.0 < local_102c) {
CBaseEntity::SetGroundEntity(param_1,(CBaseEntity *)0x0);
}
UTIL_Remove((CBaseEntity *)this);
return;
}
CVar1 = param_1[0x186];
if (CVar1 == (CBaseEntity)0x6) {
if ((*(uint *)(this + 0x148) & 0x1000) == 0) {
piVar2 = *(int **)(param_1 + 0x238);
if (piVar2 != (int *)0x0) {
local_101c[2] = *(float *)(gpGlobals + 0x10) * *(float *)(this + 0x580) * 100.0;
local_101c[0] = local_1034 * local_101c[2];
local_101c[1] = local_1030 * local_101c[2];
local_101c[2] = local_102c * local_101c[2];
(**(code **)(*piVar2 + 0xf4))(piVar2,local_101c);
}
}
else {
iVar4 = (**(code **)(*(int *)param_1 + 0x2b8))(param_1,local_101c,0x400);
if (0 < iVar4) {
iVar5 = 0;
do {
piVar2 = (int *)local_101c[iVar5];
local_1020 = *(float *)(gpGlobals + 0x10) * *(float *)(this + 0x580) * 100.0;
local_1028 = local_1034 * local_1020;
local_1024 = local_1030 * local_1020;
local_1020 = local_102c * local_1020;
lVar6 = (longdouble)(**(code **)(*piVar2 + 0x78))(piVar2);
piVar2 = (int *)local_101c[iVar5];
iVar5 = iVar5 + 1;
fVar7 = (float)lVar6 * 0.01;
local_1028 = local_1028 * fVar7;
local_1024 = local_1024 * fVar7;
local_1020 = fVar7 * local_1020;
(**(code **)(*piVar2 + 0xf4))(piVar2,&local_1028);
} while (iVar5 != iVar4);
}
}
}
else if ((byte)CVar1 < 7) {
if (CVar1 != (CBaseEntity)0x0) {
LAB_00b19537:
fVar7 = *(float *)(this + 0x580);
fVar8 = local_1034 * fVar7;
fVar9 = local_1030 * fVar7;
fVar7 = fVar7 * local_102c;
if ((*(uint *)(param_1 + 0x150) & 0x800000) != 0) {
fVar8 = fVar8 + *(float *)(param_1 + 0x268);
fVar9 = fVar9 + *(float *)(param_1 + 0x26c);
fVar7 = fVar7 + *(float *)(param_1 + 0x270);
}
if ((0.0 < fVar7) && ((*(uint *)(param_1 + 0x150) & 1) != 0)) {
CBaseEntity::SetGroundEntity(param_1,(CBaseEntity *)0x0);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
local_101c[0] = *(float *)(param_1 + 0x2e0);
local_101c[1] = *(float *)(param_1 + 0x2e4);
local_101c[2] = *(float *)(param_1 + 0x2e8) + 1.0;
CBaseEntity::SetAbsOrigin(param_1,(Vector *)local_101c);
}
if (((fVar8 != *(float *)(param_1 + 0x268)) || (fVar9 != *(float *)(param_1 + 0x26c))) ||
(fVar7 != *(float *)(param_1 + 0x270))) {
(**(code **)(*(int *)param_1 + 0x2fc))(param_1,param_1 + 0x268);
*(float *)(param_1 + 0x268) = fVar8;
*(float *)(param_1 + 0x26c) = fVar9;
*(float *)(param_1 + 0x270) = fVar7;
}
CBaseEntity::AddFlag(param_1,0x800000);
return;
}
}
else if (8 < (byte)CVar1) goto LAB_00b19537;
}
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.