CTerrorPlayer::UpdateHangingFromTongue
0x009fc350 · 1102 bytes · __thiscall
_ZN13CTerrorPlayer23UpdateHangingFromTongueEv
Decompiled
undefined (1 param)
/* CTerrorPlayer::UpdateHangingFromTongue() */
void __thiscall CTerrorPlayer::UpdateHangingFromTongue(CTerrorPlayer *this)
{
uint uVar1;
code *pcVar2;
char cVar3;
int iVar4;
undefined *puVar5;
CBaseEntity *pCVar6;
longdouble lVar7;
float fVar8;
CTakeDamageInfo local_7c [108];
if (this[0x33dc] == (CTerrorPlayer)0x0) {
cVar3 = CTerrorGameRules::HasPlayerControlledZombies();
if ((((cVar3 != '\0') && (uVar1 = *(uint *)(this + 0x33c4), uVar1 != 0xffffffff)) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
lVar7 = (longdouble)CountdownTimer::Now();
if (((*(float *)(this + 0x3408) <= (float)lVar7) &&
((uVar1 = *(uint *)(this + 0x33c4), uVar1 != 0xffffffff &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc))))
&& ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
fVar8 = *(float *)(TongueChokeDamageInterval._28_4_ + 0x2c);
lVar7 = (longdouble)CountdownTimer::Now();
if ((float)lVar7 + fVar8 != *(float *)(this + 0x3408)) {
(**(code **)(*(int *)(this + 0x3400) + 4))(this + 0x3400,this + 0x3408);
*(float *)(this + 0x3408) = (float)lVar7 + fVar8;
}
if (fVar8 != *(float *)(this + 0x3404)) {
(**(code **)(*(int *)(this + 0x3400) + 4))(this + 0x3400,this + 0x3404);
*(float *)(this + 0x3404) = fVar8;
}
fVar8 = *(float *)(TongueDragDamageAmount._28_4_ + 0x2c);
goto LAB_009fc55a;
}
}
}
else {
lVar7 = (longdouble)CountdownTimer::Now();
if ((((*(float *)(this + 0x334c) <= (float)lVar7) &&
(uVar1 = *(uint *)(this + 0x33c4), uVar1 != 0xffffffff)) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
lVar7 = (longdouble)RandomFloat(0x3f800000,0x40000000);
fVar8 = (float)lVar7;
lVar7 = (longdouble)CountdownTimer::Now();
if ((float)lVar7 + fVar8 != *(float *)(this + 0x334c)) {
(**(code **)(*(int *)(this + 0x3344) + 4))(this + 0x3344,this + 0x334c);
*(float *)(this + 0x334c) = (float)lVar7 + fVar8;
}
if (fVar8 != *(float *)(this + 0x3348)) {
(**(code **)(*(int *)(this + 0x3344) + 4))(this + 0x3344,this + 0x3348);
*(float *)(this + 0x3348) = fVar8;
}
pcVar2 = *(code **)(*(int *)this + 0x7b4);
CAI_Concept::CAI_Concept((CAI_Concept *)local_7c,"PlayerChoke");
(*pcVar2)(this,(CAI_Concept *)local_7c,1,0,0,0,0);
}
lVar7 = (longdouble)CountdownTimer::Now();
if (((*(float *)(this + 0x33f0) <= (float)lVar7) &&
(uVar1 = *(uint *)(this + 0x33c4), uVar1 != 0xffffffff)) &&
((puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc &&
((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))))) {
fVar8 = *(float *)(TongueChokeDamageInterval._28_4_ + 0x2c);
lVar7 = (longdouble)CountdownTimer::Now();
if ((float)lVar7 + fVar8 != *(float *)(this + 0x33f0)) {
(**(code **)(*(int *)(this + 0x33e8) + 4))(this + 0x33e8,this + 0x33f0);
*(float *)(this + 0x33f0) = (float)lVar7 + fVar8;
}
if (fVar8 != *(float *)(this + 0x33ec)) {
(**(code **)(*(int *)(this + 0x33e8) + 4))(this + 0x33e8,this + 0x33ec);
*(float *)(this + 0x33ec) = fVar8;
}
fVar8 = *(float *)(TongueChokeDamageAmount._28_4_ + 0x2c);
iVar4 = GetDifficulty();
if (iVar4 == 2) {
fVar8 = fVar8 + fVar8;
}
else if (iVar4 == 3) {
fVar8 = fVar8 * 3.0;
}
LAB_009fc55a:
uVar1 = *(uint *)(this + 0x33c4);
if (((uVar1 == 0xffffffff) ||
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
pCVar6 = (CBaseEntity *)0x0;
}
else {
pCVar6 = *(CBaseEntity **)(puVar5 + 4);
}
CTakeDamageInfo::CTakeDamageInfo(local_7c,pCVar6,pCVar6,fVar8,0x100000,0);
CBaseEntity::TakeDamage((CBaseEntity *)this,local_7c);
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.