WitchAttack::OnContact
0x00a3cc20 · 1107 bytes · __cdecl
_ZN11WitchAttack9OnContactEP8InfectedP11CBaseEntityP10CGameTrace
Decompiled
undefined (3 params)
/* WitchAttack::OnContact(Infected*, CBaseEntity*, CGameTrace*) */
Infected * WitchAttack::OnContact(Infected *param_1,CBaseEntity *param_2,CGameTrace *param_3)
{
uint uVar1;
uint uVar2;
char cVar3;
int iVar4;
int *piVar5;
CBaseEntity *pCVar6;
int iVar7;
CTerrorPlayer *this;
uint *puVar8;
undefined4 *puVar9;
undefined *puVar10;
int iVar11;
longdouble lVar12;
CBaseEntity *in_stack_00000010;
int in_stack_00000014;
undefined4 local_20 [4];
if (in_stack_00000010 == (CBaseEntity *)0x0) goto LAB_00a3cc87;
cVar3 = IsBreakableEntity(in_stack_00000010,false,true,(CTakeDamageInfo *)0x0);
if ((((cVar3 == '\0') && (*(char **)(in_stack_00000010 + 0x7c) != "prop_door*")) &&
(cVar3 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"prop_door*"), cVar3 == '\0')) &&
((*(char **)(in_stack_00000010 + 0x7c) != "func_door*" &&
(cVar3 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"func_door*"), cVar3 == '\0')))) {
cVar3 = (**(code **)(*(int *)in_stack_00000010 + 0x16c))();
if (cVar3 != '\0') {
piVar5 = (int *)(**(code **)(*(int *)param_3 + 0x590))(param_3);
cVar3 = (**(code **)(*piVar5 + 0x174))(piVar5);
if ((cVar3 != '\0') &&
(pCVar6 = (CBaseEntity *)GetVictim((WitchAttack *)param_2), pCVar6 != (CBaseEntity *)0x0))
{
if (*(int *)(pCVar6 + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(pCVar6 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
if (*(int *)(in_stack_00000010 + 0x30) == 0) {
iVar7 = 0;
}
else {
iVar7 = *(int *)(in_stack_00000010 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
if (iVar4 != iVar7) {
cVar3 = (**(code **)(*(int *)in_stack_00000010 + 0x16c))();
this = (CTerrorPlayer *)0x0;
if (cVar3 != '\0') {
this = (CTerrorPlayer *)in_stack_00000010;
}
cVar3 = CTerrorPlayer::IsStaggering(this);
if (cVar3 == '\0') {
puVar8 = (uint *)(**(code **)(*(int *)in_stack_00000010 + 0xc))();
uVar1 = *puVar8;
if (0 < *(int *)(param_2 + 0x486c)) {
iVar4 = 0;
piVar5 = (int *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4);
do {
iVar7 = 0;
if (uVar1 != 0xffffffff) {
if (piVar5 == (int *)0x0) {
iVar7 = 0;
}
else if (piVar5[1] == uVar1 >> 0xc) {
iVar7 = *piVar5;
}
}
iVar11 = 0;
uVar2 = *(uint *)(*(int *)(param_2 + 0x4860) + iVar4 * 4);
if (((uVar2 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10,
puVar10 != (undefined *)0xfffffffc)) && (*(uint *)(puVar10 + 8) == uVar2 >> 0xc)
) {
iVar11 = *(int *)(puVar10 + 4);
}
if (iVar7 == iVar11) {
if (*(int *)(ZombieWitchAllowChangeVictim._28_4_ + 0x30) != 0) {
lVar12 = (longdouble)IntervalTimer::Now();
if ((5.0 < (float)lVar12 - *(float *)(param_2 + 0x4878)) &&
(cVar3 = IsValidEnemy(pCVar6), cVar3 != '\0')) {
*(undefined4 *)(param_2 + 0x486c) = 0;
lVar12 = (longdouble)IntervalTimer::Now();
if ((float)lVar12 != *(float *)(param_2 + 0x4878)) {
(**(code **)(*(int *)(param_2 + 0x4874) + 4))
(param_2 + 0x4874,param_2 + 0x4878);
*(float *)(param_2 + 0x4878) = (float)lVar12;
}
SetVictim((WitchAttack *)param_2,in_stack_00000010);
if (*(float *)(param_2 + 0x4830) != -1.0) {
(**(code **)(*(int *)(param_2 + 0x4828) + 4))
(param_2 + 0x4828,param_2 + 0x4830);
*(undefined4 *)(param_2 + 0x4830) = 0xbf800000;
}
if (*(float *)(param_2 + 0x483c) != -1.0) {
(**(code **)(*(int *)(param_2 + 0x4834) + 4))
(param_2 + 0x4834,param_2 + 0x483c);
*(undefined4 *)(param_2 + 0x483c) = 0xbf800000;
}
PathFollower::Invalidate((PathFollower *)(param_2 + 0x3c));
}
}
goto LAB_00a3cc87;
}
iVar4 = iVar4 + 1;
} while (iVar4 != *(int *)(param_2 + 0x486c));
}
pCVar6 = (CBaseEntity *)(**(code **)(*(int *)param_3 + 0x570))(param_3);
CTerrorPlayer::OnStaggered(this,pCVar6,(Vector *)0x0);
local_20[0] = 0xffffffff;
puVar9 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0xc))(in_stack_00000010)
;
local_20[0] = *puVar9;
CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::InsertBefore
((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
(param_2 + 0x4860),*(int *)(param_2 + 0x486c),(CHandle *)local_20);
}
}
}
goto LAB_00a3cc87;
}
iVar4 = (**(code **)(*(int *)in_stack_00000010 + 0x144))();
if (iVar4 == 0) goto LAB_00a3cc87;
iVar4 = CBaseEntity::GetTeamNumber(in_stack_00000010);
cVar3 = IsASurvivorTeam(iVar4);
if (cVar3 != '\0') goto LAB_00a3cc87;
}
else if ((in_stack_00000014 != 0) &&
(0.8 < *(float *)(in_stack_00000014 + 0x20) || *(float *)(in_stack_00000014 + 0x20) == 0.8
)) goto LAB_00a3cc87;
cVar3 = CBaseAnimatingOverlay::IsPlayingGesture((CBaseAnimatingOverlay *)param_3,0x265);
if (cVar3 == '\0') {
CBaseAnimatingOverlay::AddGesture((CBaseAnimatingOverlay *)param_3,0x265,1);
}
LAB_00a3cc87:
*(undefined4 *)param_1 = 4;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
return param_1;
}
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.