CTerrorGun::UpdateDualWield
0x00564f40 · 489 bytes · __thiscall
_ZN10CTerrorGun15UpdateDualWieldEv
Decompiled
undefined (1 param)
/* CTerrorGun::UpdateDualWield() */
void __thiscall CTerrorGun::UpdateDualWield(CTerrorGun *this)
{
code *pcVar1;
CBaseEdict *pCVar2;
char cVar3;
CBaseCombatCharacter *this_00;
CTerrorGun *pCVar4;
int iVar5;
undefined4 uVar6;
int iVar7;
int iVar8;
if (this[0x17e1] == (CTerrorGun)0x0) {
return;
}
if (this[0x1459] != (CTerrorGun)0x0) {
return;
}
if (*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x13fc) &&
*(float *)(this + 0x13fc) != *(float *)(gpGlobals + 0xc)) {
return;
}
this_00 = (CBaseCombatCharacter *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if (this_00 != (CBaseCombatCharacter *)0x0) {
pCVar4 = (CTerrorGun *)CBaseCombatCharacter::GetActiveWeapon(this_00);
if (this != pCVar4) {
return;
}
cVar3 = (**(code **)(*(int *)this + 0x674))(this);
if ((cVar3 == '\0') ||
(cVar3 = CTerrorPlayer::CanDualWield((CTerrorPlayer *)this_00), cVar3 != '\0')) {
cVar3 = (**(code **)(*(int *)this + 0x674))(this);
if (cVar3 != '\0') {
return;
}
cVar3 = CTerrorPlayer::CanDualWield((CTerrorPlayer *)this_00);
if (cVar3 == '\0') {
return;
}
if (this[0x17e0] != (CTerrorGun)0x1) {
CServerNetworkProperty::NetworkStateChanged((short)this + 0x24);
this[0x17e0] = (CTerrorGun)0x1;
}
iVar8 = *(int *)(this + 0x17e8);
if ((0 < iVar8) &&
(iVar7 = *(int *)(this + 0x1420), iVar5 = (**(code **)(*(int *)this + 0x510))(this),
iVar8 + iVar7 <= iVar5)) {
iVar8 = *(int *)(this + 0x17e8) + *(int *)(this + 0x1420);
if (*(int *)(this + 0x1420) != iVar8) {
CServerNetworkProperty::NetworkStateChanged((short)this + 0x24);
*(int *)(this + 0x1420) = iVar8;
}
*(undefined4 *)(this + 0x17e8) = 0;
}
}
else {
if (this[0x17e0] != (CTerrorGun)0x0) {
if (this[0x6c] == (CTerrorGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
}
this[0x17e0] = (CTerrorGun)0x0;
}
iVar8 = *(int *)(this + 0x1420);
iVar7 = (**(code **)(*(int *)this + 0x510))(this);
if (iVar7 < iVar8) {
iVar8 = *(int *)(this + 0x1420);
iVar7 = iVar8 - iVar8 / 2;
*(int *)(this + 0x17e8) = iVar8 / 2;
if (iVar8 != iVar7) {
if (this[0x6c] == (CTerrorGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
}
*(int *)(this + 0x1420) = iVar7;
}
}
}
(**(code **)(*(int *)this + 0x3fc))(this);
pcVar1 = *(code **)(*(int *)this + 0x70);
uVar6 = (**(code **)(*(int *)this + 0x504))(this,0);
(*pcVar1)(this,uVar6);
pcVar1 = *(code **)(*(int *)this + 0x3f0);
uVar6 = (**(code **)(*(int *)this + 0x65c))(this);
(*pcVar1)(this,uVar6);
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.