CTongue::OnEnterExtendingState
0x00844de0 · 1276 bytes · __thiscall
_ZN7CTongue21OnEnterExtendingStateEv
Decompiled
undefined (1 param)
/* CTongue::OnEnterExtendingState() */
void __thiscall CTongue::OnEnterExtendingState(CTongue *this)
{
uint uVar1;
CBaseAnimating *this_00;
code *pcVar2;
CBaseEdict *pCVar3;
CTerrorPlayer *pCVar4;
int *piVar5;
undefined4 uVar6;
undefined1 *puVar7;
undefined *puVar8;
int iVar9;
bool bVar10;
float fVar11;
float local_28;
float local_24;
float local_20;
uVar1 = *(uint *)(this + 0x44c);
if ((((uVar1 == 0xffffffff) ||
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) ||
(this_00 = *(CBaseAnimating **)(puVar8 + 4), this_00 == (CBaseAnimating *)0x0)) {
return;
}
pCVar4 = (CTerrorPlayer *)GetCurrentTongueTarget(this);
CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)&local_28,pCVar4);
if (((local_28 == -NAN) ||
(puVar8 = g_pEntityList + ((uint)local_28 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar8 + 8) != (uint)local_28 >> 0xc)) {
iVar9 = 0;
}
else {
iVar9 = *(int *)(puVar8 + 4);
}
uVar1 = *(uint *)(this + 0x480);
if (((uVar1 == 0xffffffff) ||
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) {
if (iVar9 == 0) goto LAB_00844eab;
}
else if (iVar9 == *(int *)(puVar8 + 4)) goto LAB_00844eab;
if (this[0x6c] == (CTongue)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTongue)((byte)this[0x70] | 1);
}
*(float *)(this + 0x480) = local_28;
LAB_00844eab:
iVar9 = CBaseAnimating::FindBodygroupByName(this_00,"tongue");
CBaseAnimating::SetBodygroup(this_00,iVar9,1);
if (*(int *)(this + 0x534) != 0) {
if (this[0x6c] == (CTongue)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTongue)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x534) = 0;
}
fVar11 = *(float *)(this + 0x544);
if (((fVar11 != *(float *)(this + 0x538)) ||
(*(float *)(this + 0x548) != *(float *)(this + 0x53c))) ||
(*(float *)(this + 0x54c) != *(float *)(this + 0x540))) {
if (this[0x6c] == (CTongue)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar9 + 2) = 0;
fVar11 = *(float *)(this + 0x544);
}
}
else {
this[0x70] = (CTongue)((byte)this[0x70] | 1);
}
*(float *)(this + 0x538) = fVar11;
*(undefined4 *)(this + 0x53c) = *(undefined4 *)(this + 0x548);
*(undefined4 *)(this + 0x540) = *(undefined4 *)(this + 0x54c);
}
CBasePlayer::EyeVectors((CBasePlayer *)this_00,(Vector *)&local_28,(Vector *)0x0,(Vector *)0x0);
uVar6 = TongueMissDelay._28_4_;
fVar11 = *(float *)(TongueFlySpeed._28_4_ + 0x2c);
*(float *)(this + 0x560) = local_24 * fVar11;
*(float *)(this + 0x564) = local_20 * fVar11;
*(float *)(this + 0x55c) = fVar11 * local_28;
CBaseAbility::StartActivationTimer((CBaseAbility *)this,*(float *)(uVar6 + 0x2c),0.0);
if (*(float *)(this + 0x49c) != -1.0) {
(**(code **)(*(int *)(this + 0x498) + 4))(this + 0x498,this + 0x49c);
*(undefined4 *)(this + 0x49c) = 0xbf800000;
}
CTerrorPlayer::Vocalize((CTerrorPlayer *)this_00,"SmokerZombie.TongueAttack",0.0,0.0);
(**(code **)(*(int *)this_00 + 0x7fc))(this_00,0x58,0);
piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_00);
if (piVar5 != (int *)0x0) {
(**(code **)(*piVar5 + 0x3f0))(piVar5,0x32a);
}
piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"ability_use",0,0);
if (piVar5 != (int *)0x0) {
pcVar2 = *(code **)(*piVar5 + 0x30);
uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
(*pcVar2)(piVar5,"userid",uVar6);
puVar7 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar7 = *(undefined1 **)(this + 0x7c);
}
bVar10 = false;
(**(code **)(*piVar5 + 0x3c))(piVar5,"ability",puVar7);
uVar1 = *(uint *)(this + 0x480);
if (((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
bVar10 = *(int *)(puVar8 + 4) != 0;
}
(**(code **)(*piVar5 + 0x30))(piVar5,"context",bVar10);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
}
uVar1 = *(uint *)(this + 0x480);
if (((uVar1 == 0xffffffff) ||
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar8 + 8) != uVar1 >> 0xc || (*(int *)(puVar8 + 4) == 0)))) {
(**(code **)(*(int *)this + 0x390))(this,"Tongue launching as a miss.");
if (*(int *)(this + 0x4ac) != 1) {
State_Transition();
}
}
else {
(**(code **)(*(int *)this + 0x394))
(this,*(int *)(puVar8 + 4),"Tongue launching towards victim.");
}
CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)(this + 0x538));
CBaseEntity::EmitSound((CBaseEntity *)this,"SmokerZombie.TongueFly",0.0,(float *)0x0);
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.