CWeaponCSBase::CanPlayerTouch
0x0043efc0 · 366 bytes · __thiscall
_ZN13CWeaponCSBase14CanPlayerTouchEP9CCSPlayer
Decompiled
undefined (2 params)
/* CWeaponCSBase::CanPlayerTouch(CCSPlayer*) */
char __thiscall CWeaponCSBase::CanPlayerTouch(CWeaponCSBase *this,CCSPlayer *param_1)
{
int *piVar1;
char cVar2;
int iVar3;
float local_18;
float local_14;
float local_10;
if ((((param_1 == (CCSPlayer *)0x0) ||
((iVar3 = CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)this),
*(int *)(iVar3 + 0x894) != 0xe &&
(iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar3 == 3)))) ||
((*(CCSPlayer **)(this + 0x1504) != (CCSPlayer *)0x0 &&
((param_1 == *(CCSPlayer **)(this + 0x1504) &&
(*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x1500) &&
*(float *)(this + 0x1500) != *(float *)(gpGlobals + 0xc))))))) ||
((((iVar3 = CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)this),
*(int *)(iVar3 + 0x158) == 0 ||
((iVar3 = CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)this),
*(int *)(iVar3 + 0x158) == 1 ||
(iVar3 = CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)this),
*(int *)(iVar3 + 0x158) == 2)))) &&
(cVar2 = (**(code **)(*(int *)this + 0x60c))(this), cVar2 == '\0')) &&
(cVar2 = (**(code **)(*(int *)param_1 + 0x480))(param_1,this), cVar2 != '\0')))) {
return false;
}
local_18 = vec3_origin;
local_14 = DAT_01053d4c;
local_10 = DAT_01053d50;
piVar1 = *(int **)(this + 0x238);
if (piVar1 != (int *)0x0) {
(**(code **)(*piVar1 + 0xd4))(piVar1,&local_18,0);
}
cVar2 = (**(code **)(*(int *)this + 0x60c))(this);
if ((cVar2 == '\0') && (1.0 <= local_14 * local_14 + local_10 * local_10 + local_18 * local_18)) {
return param_1 != *(CCSPlayer **)(this + 0x1504);
}
return cVar2;
}
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.