CTerrorWeapon::DefaultTouch
0x00573e50 · 264 bytes · __thiscall
_ZN13CTerrorWeapon12DefaultTouchEP11CBaseEntity
Decompiled
undefined (2 params)
/* CTerrorWeapon::DefaultTouch(CBaseEntity*) */
void __thiscall CTerrorWeapon::DefaultTouch(CTerrorWeapon *this,CBaseEntity *param_1)
{
ushort uVar1;
uint uVar2;
char cVar3;
CBaseEntity *pCVar4;
undefined *puVar5;
if (param_1 != (CBaseEntity *)0x0) {
cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
if (cVar3 != '\0') {
uVar1 = *(ushort *)(this + 0x1b4);
pCVar4 = (CBaseEntity *)CBaseCombatWeapon::GetOwner((CBaseCombatWeapon *)this);
if ((param_1 == pCVar4) || ((uVar1 >> 2 & 1) != 0)) {
DevWarning("Touching our own weapons\n");
return;
}
cVar3 = (**(code **)(*(int *)this + 0x608))(this,param_1);
if (cVar3 != '\0') {
CBaseCombatWeapon::DefaultTouch((CBaseCombatWeapon *)this,param_1);
pCVar4 = (CBaseEntity *)GetPlayerOwner(this);
if (param_1 == pCVar4) {
pCVar4 = (CBaseEntity *)(**(code **)(*(int *)this + 0x5e0))(this);
if (pCVar4 != (CBaseEntity *)0x0) {
cVar3 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4);
if ((cVar3 != '\0') && (param_1 != pCVar4)) {
uVar2 = *(uint *)(this + 0x179c);
if (((uVar2 != 0xffffffff) &&
(((puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10,
puVar5 != (undefined *)0xfffffffc && (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) &&
(*(CBaseEntity **)(puVar5 + 4) != (CBaseEntity *)0x0)))) &&
(param_1 == *(CBaseEntity **)(puVar5 + 4))) {
CTerrorPlayer::OnGivenWeapon((CTerrorPlayer *)param_1,this);
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.