CTerrorPlayer::OnLungeStart
0x009a50b0 · 1323 bytes · __thiscall
_ZN13CTerrorPlayer12OnLungeStartEv
Decompiled
undefined (1 param)
/* CTerrorPlayer::OnLungeStart() */
void __thiscall CTerrorPlayer::OnLungeStart(CTerrorPlayer *this)
{
CBaseEdict *pCVar1;
uint uVar2;
char cVar3;
int iVar4;
undefined4 uVar5;
int *piVar6;
undefined *puVar7;
int iVar8;
undefined *puVar9;
CTerrorPlayer CVar10;
undefined4 uVar11;
undefined *puVar12;
longdouble lVar13;
float fVar14;
int local_20;
OnPounceEnded(this);
cVar3 = CTerrorGameRules::HasPlayerControlledZombies();
if (cVar3 == '\0') {
cVar3 = (**(code **)(*(int *)this + 0x558))(this);
if (cVar3 == '\0') {
if ((this[0x1a90] == (CTerrorPlayer)0x0) || (iVar4 = GetStaggerDir(this), iVar4 != 0)) {
CVar10 = (CTerrorPlayer)0x0;
}
else {
CVar10 = (CTerrorPlayer)((byte)(*(uint *)(this + 0x1cb0) >> 2) & 1);
}
if (CVar10 != this[0x3e78]) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x3e78] = CVar10;
}
cVar3 = IsLunging(this);
if (cVar3 != '\0') goto LAB_009a52a3;
uVar11 = *(undefined4 *)(ZombiePounceDamageInterrupt._28_4_ + 0x30);
*(undefined4 *)(this + 0x3e7c) = uVar11;
if (this[0x3e78] != (CTerrorPlayer)0x0) goto LAB_009a5114;
}
else {
LAB_009a52a3:
if (this[0x3e78] != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x3e78] = (CTerrorPlayer)0x0;
}
*(undefined4 *)(this + 0x3e7c) = *(undefined4 *)(ZombiePounceDamageInterrupt._28_4_ + 0x30);
}
cVar3 = (**(code **)(*(int *)this + 0x558))(this);
if (cVar3 != '\0') goto LAB_009a52d1;
uVar11 = *(undefined4 *)(this + 0x3e7c);
uVar5 = (**(code **)(*(int *)this + 0xb8))(this);
UTIL_LogPrintf("%s starting a lunge, %d damage interrupts\n",uVar5,uVar11);
CBaseEntity::EmitSound((CBaseEntity *)this,"HunterZombie.Lunge",0.0,(float *)0x0);
}
else {
if (this[0x3e78] != (CTerrorPlayer)0x1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
this[0x3e78] = (CTerrorPlayer)0x1;
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
this[0x3e78] = (CTerrorPlayer)0x1;
}
}
uVar11 = *(undefined4 *)(ZombiePounceDamageInterrupt._28_4_ + 0x30);
*(undefined4 *)(this + 0x3e7c) = uVar11;
LAB_009a5114:
uVar5 = (**(code **)(*(int *)this + 0xb8))(this);
UTIL_LogPrintf("%s starting a pounce, %d damage interrupts\n",uVar5,uVar11);
piVar6 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if (piVar6 != (int *)0x0) {
(**(code **)(*piVar6 + 0x3f0))(piVar6,0x325);
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
fVar14 = *(float *)(this + 0x2e0);
if (((fVar14 != *(float *)(this + 16000)) ||
(*(float *)(this + 0x2e4) != *(float *)(this + 0x3e84))) ||
(*(float *)(this + 0x2e8) != *(float *)(this + 0x3e88))) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
fVar14 = *(float *)(this + 0x2e0);
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(float *)(this + 16000) = fVar14;
*(undefined4 *)(this + 0x3e84) = *(undefined4 *)(this + 0x2e4);
*(undefined4 *)(this + 0x3e88) = *(undefined4 *)(this + 0x2e8);
}
if (0.0 < *(float *)(this + 0x3eb4)) {
lVar13 = (longdouble)IntervalTimer::Now();
if (((float)lVar13 - *(float *)(this + 0x3eb4) < 1.5) && (0.0 < *(float *)(this + 0x3eb4)))
goto LAB_009a52d1;
}
CBaseEntity::EmitSound((CBaseEntity *)this,"HunterZombie.Pounce",0.0,(float *)0x0);
lVar13 = (longdouble)IntervalTimer::Now();
if ((float)lVar13 != *(float *)(this + 0x3eb4)) {
(**(code **)(*(int *)(this + 0x3eb0) + 4))(this + 0x3eb0,this + 0x3eb4);
*(float *)(this + 0x3eb4) = (float)lVar13;
}
}
CBasePlayer::RumbleEffect((CBasePlayer *)this,'$','\0','\x04');
LAB_009a52d1:
puVar7 = g_pEntityList;
puVar12 = g_pEntityList + 4;
if ((puVar12 == (undefined *)0x0) || (*(int *)(g_pEntityList + 8) != 0)) {
local_20 = 0;
}
else {
local_20 = *(int *)(g_pEntityList + 4);
}
uVar2 = *(uint *)(this + 0x3e64);
if (((uVar2 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(puVar9 + 4);
}
if (local_20 != iVar4) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
puVar12 = g_pEntityList + 4;
puVar7 = g_pEntityList;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3e64) = 0;
}
if ((puVar12 == (undefined *)0x0) || (*(int *)(puVar7 + 8) != 0)) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(puVar7 + 4);
}
uVar2 = *(uint *)(this + 0x3e68);
if (((uVar2 == 0xffffffff) ||
(puVar7 = puVar7 + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) {
iVar8 = 0;
}
else {
iVar8 = *(int *)(puVar7 + 4);
}
if (iVar4 != iVar8) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
*(undefined4 *)(this + 0x3e68) = 0;
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
*(undefined4 *)(this + 0x3e68) = 0;
}
}
lVar13 = (longdouble)IntervalTimer::Now();
if ((float)lVar13 != *(float *)(this + 0x3eac)) {
(**(code **)(*(int *)(this + 0x3ea8) + 4))(this + 0x3ea8,this + 0x3eac);
*(float *)(this + 0x3eac) = (float)lVar13;
}
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.