CBaseCombatWeapon::SetOwner
0x00407b00 · 229 bytes · __thiscall
_ZN17CBaseCombatWeapon8SetOwnerEP20CBaseCombatCharacter
Decompiled
undefined (2 params)
/* CBaseCombatWeapon::SetOwner(CBaseCombatCharacter*) */
void __thiscall CBaseCombatWeapon::SetOwner(CBaseCombatWeapon *this,CBaseCombatCharacter *param_1)
{
uint uVar1;
CBaseEdict *this_00;
uint *puVar2;
undefined *puVar3;
int iVar4;
uint uVar5;
int iVar6;
if (param_1 == (CBaseCombatCharacter *)0x0) {
uVar5 = 0xffffffff;
iVar6 = 0;
}
else {
puVar2 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar5 = *puVar2;
if (((uVar5 == 0xffffffff) ||
(puVar3 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar3 + 8) != uVar5 >> 0xc)) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(puVar3 + 4);
}
}
uVar1 = *(uint *)(this + 0x13f4);
if (((uVar1 == 0xffffffff) ||
(puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar3 + 8) != uVar1 >> 0xc)) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(puVar3 + 4);
}
if (iVar6 == iVar4) {
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
return;
}
if (this[0x6c] == (CBaseCombatWeapon)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar6 + 2) = 0;
}
*(uint *)(this + 0x13f4) = uVar5;
}
else {
this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
*(uint *)(this + 0x13f4) = uVar5;
}
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
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.