CTerrorPlayer::UpdateAddonBits
0x0099d130 · 1064 bytes · __thiscall
_ZN13CTerrorPlayer15UpdateAddonBitsEv
Decompiled
undefined (1 param)
/* CTerrorPlayer::UpdateAddonBits() */
void __thiscall CTerrorPlayer::UpdateAddonBits(CTerrorPlayer *this)
{
CBaseEdict *pCVar1;
char cVar2;
int iVar3;
int *piVar4;
int iVar5;
uint uVar6;
CTerrorMeleeWeapon *this_00;
undefined *puVar7;
CTerrorPlayer *__s1;
uint local_34;
int *local_30;
uint local_20 [4];
iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
cVar2 = IsASurvivorTeam(iVar3);
if (cVar2 == '\0') {
if (*(int *)(this + 0x29a0) == 0) {
return;
}
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x29a0) = 0;
return;
}
piVar4 = (int *)GetActiveTerrorWeapon(this);
if (piVar4 == (int *)0x0) {
cVar2 = CTerrorPlayerAnimState::ShouldHideWeapon(*(CTerrorPlayerAnimState **)(this + 0x2910));
local_30 = piVar4;
if (cVar2 == '\0') goto LAB_0099d1b8;
}
else {
iVar3 = (**(code **)(*piVar4 + 0x530))(piVar4);
cVar2 = CTerrorPlayerAnimState::ShouldHideWeapon(*(CTerrorPlayerAnimState **)(this + 0x2910));
if ((cVar2 == '\0') || (iVar3 == 3)) {
cVar2 = (**(code **)(*piVar4 + 0x434))(piVar4);
local_30 = (int *)0x0;
if (cVar2 != '\0') {
local_30 = piVar4;
}
goto LAB_0099d1b8;
}
}
local_30 = (int *)0x0;
LAB_0099d1b8:
__s1 = this + 0x29a4;
local_34 = 0;
iVar3 = 0;
do {
piVar4 = (int *)(**(code **)(*(int *)this + 0x484))(this,iVar3);
if ((local_30 == piVar4) || (piVar4 == (int *)0x0)) {
local_20[0] = 0;
iVar5 = memcmp(__s1,local_20,4);
if (iVar5 != 0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(uint *)__s1 = 0;
}
}
else {
uVar6 = (**(code **)(*piVar4 + 0x638))(piVar4);
if (uVar6 == 0x13) {
this_00 = (CTerrorMeleeWeapon *)
__dynamic_cast(piVar4,&CBaseCombatWeapon::typeinfo,&CTerrorMeleeWeapon::typeinfo,0
);
if (this_00 != (CTerrorMeleeWeapon *)0x0) {
uVar6 = CTerrorMeleeWeapon::GetMeleeWeaponInfoHandle(this_00);
local_20[0] = uVar6 | 0x40;
iVar5 = memcmp(__s1,local_20,4);
if (iVar5 != 0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(uint *)__s1 = uVar6 | 0x40;
}
}
}
else {
local_20[0] = uVar6;
iVar5 = memcmp(__s1,local_20,4);
if (iVar5 != 0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(uint *)__s1 = uVar6;
}
}
local_34 = local_34 | 1 << ((byte)iVar3 & 0x1f);
}
iVar3 = iVar3 + 1;
__s1 = __s1 + 4;
} while (iVar3 != 5);
uVar6 = *(uint *)(this + 0x33c4);
if ((((uVar6 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar6 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
cVar2 = (**(code **)(*(int *)this + 300))(this);
if (((cVar2 != '\0') && (iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar3 == 2))
&& (iVar3 = CDirector::GetScriptValue(TheDirector,"GasCansOnBacks",0), iVar3 != 0)) {
local_34 = local_34 & 0xfffffff7 | 0x80;
local_20[0] = 0;
iVar3 = memcmp(this + 0x29b0,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x29b0) = 0;
}
}
}
else {
local_34 = local_34 | 0x20;
}
uVar6 = local_34;
if (local_30 != (int *)0x0) {
iVar3 = (**(code **)(*local_30 + 0x638))(local_30);
uVar6 = local_34 | 0x40;
if (iVar3 != 0x18) {
uVar6 = local_34;
}
}
local_34 = uVar6;
if (local_34 == *(uint *)(this + 0x29a0)) {
return;
}
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(uint *)(this + 0x29a0) = local_34;
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.