ChaseVictim::OnContact
0x00a2a270 · 3265 bytes · __cdecl
_ZN11ChaseVictim9OnContactEP8InfectedP11CBaseEntityP10CGameTrace
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ChaseVictim::OnContact(Infected*, CBaseEntity*, CGameTrace*) */
Infected * ChaseVictim::OnContact(Infected *param_1,CBaseEntity *param_2,CGameTrace *param_3)
{
uint *puVar1;
float fVar2;
undefined4 uVar3;
code *pcVar4;
uint uVar5;
char cVar6;
int *piVar7;
undefined4 *puVar8;
undefined4 *puVar9;
CBaseEntity *pCVar10;
undefined *puVar11;
int iVar12;
int iVar13;
float *pfVar14;
int *piVar15;
Vector *pVVar16;
int iVar17;
int *piVar18;
float fVar19;
longdouble lVar20;
float fVar21;
CBaseEntity *in_stack_00000010;
int in_stack_00000014;
float local_88;
float local_84;
float local_80;
float local_7c;
float local_78;
float local_74;
piVar7 = (int *)&stack0xffffff24;
if (_towlower == 0) {
iVar17 = 0;
}
else {
(**(code **)(_towlower + 0x50))();
iVar17 = _towlower;
}
iVar12 = _DAT_0105db00;
/* try { // try from 00a2a56e to 00a2a5ce has its CatchHandler @ 00a2af69 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar13 = ThreadGetCurrentId(), iVar12 == iVar13)) {
if ((char *)*_DAT_0105d15c != "InfectedAttack::ChaseVictim::OnContact") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd2281c,(char *)0x0,0xca8906);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
piVar18 = (int *)&stack0xffffff24;
if (in_stack_00000010 != (CBaseEntity *)0x0) {
/* try { // try from 00a2a362 to 00a2a4b2 has its CatchHandler @ 00a2af81 */
/* try { // try from 00a2a677 to 00a2a979 has its CatchHandler @ 00a2af81 */
if ((((*(char **)(in_stack_00000010 + 0x7c) == "prop_door*") ||
(cVar6 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"prop_door*"), cVar6 != '\0'))
|| ((*(char **)(in_stack_00000010 + 0x7c) == "func_door*" ||
(cVar6 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"func_door*"), cVar6 != '\0'
)))) && (cVar6 = (**(code **)(*(int *)param_3 + 0x568))(), cVar6 != '\0')) {
pCVar10 = (CBaseEntity *)__dynamic_cast();
if (pCVar10 == (CBaseEntity *)0x0) {
piVar15 = (int *)__dynamic_cast();
piVar18 = (int *)&stack0xffffff24;
if (piVar15 != (int *)0x0) {
if ((char)piVar15[0x13f] != '\0') {
puVar8 = ::operator_new(0x5c);
uVar3 = *(undefined4 *)(param_2 + 0x34);
puVar8[8] = 0;
puVar8[9] = 0;
puVar8[10] = 0;
puVar8[3] = 0;
puVar8[4] = 0;
puVar8[5] = 0;
puVar8[6] = 0;
puVar8[7] = 0;
puVar8[2] = 0;
*(undefined1 *)(puVar8 + 0xc) = 0;
*(undefined1 *)((int)puVar8 + 0x31) = 0;
puVar8[0xb] = 0;
*puVar8 = &PTR__PunchVictim_00d230a8;
puVar8[1] = &PTR__PunchVictim_00d2320c;
puVar8[0xe] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0xf] = 0;
puVar8[0x10] = 0xbf800000;
puVar8[0x11] = &PTR_NetworkStateChanged_00c23e10;
puVar8[0x12] = 0xbf800000;
puVar8[0x13] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0x14] = 0;
puVar8[0x15] = 0xbf800000;
puVar8[0x16] = 0xffffffff;
puVar8[0xd] = uVar3;
/* try { // try from 00a2adee to 00a2adf0 has its CatchHandler @ 00a2af91 */
puVar9 = (undefined4 *)(**(code **)(*piVar15 + 0xc))();
goto LAB_00a2ac19;
}
/* try { // try from 00a2ac88 to 00a2ad43 has its CatchHandler @ 00a2af81 */
lVar20 = (longdouble)CountdownTimer::Now();
piVar18 = (int *)&stack0xffffff24;
if (*(float *)(param_2 + 0x485c) <= (float)lVar20) {
lVar20 = (longdouble)CountdownTimer::Now();
if ((float)lVar20 + 1.0 != *(float *)(param_2 + 0x485c)) {
(**(code **)(*(int *)(param_2 + 0x4854) + 4))();
*(float *)(param_2 + 0x485c) = (float)lVar20 + 1.0;
}
if (*(float *)(param_2 + 0x4858) != 1.0) {
(**(code **)(*(int *)(param_2 + 0x4854) + 4))();
*(undefined4 *)(param_2 + 0x4858) = 0x3f800000;
}
NextBotCombatCharacter::UseEntity();
piVar18 = (int *)&stack0xffffff24;
}
}
}
else {
if (*(int *)(pCVar10 + 0x15f4) == 0) {
puVar8 = ::operator_new(0x5c);
uVar3 = *(undefined4 *)(param_2 + 0x34);
puVar8[8] = 0;
puVar8[9] = 0;
puVar8[10] = 0;
puVar8[3] = 0;
puVar8[4] = 0;
puVar8[5] = 0;
puVar8[6] = 0;
puVar8[7] = 0;
puVar8[2] = 0;
*(undefined1 *)(puVar8 + 0xc) = 0;
*(undefined1 *)((int)puVar8 + 0x31) = 0;
puVar8[0xb] = 0;
*puVar8 = &PTR__PunchVictim_00d230a8;
puVar8[1] = &PTR__PunchVictim_00d2320c;
puVar8[0xe] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0xf] = 0;
puVar8[0x10] = 0xbf800000;
puVar8[0x11] = &PTR_NetworkStateChanged_00c23e10;
puVar8[0x12] = 0xbf800000;
puVar8[0x13] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0x14] = 0;
puVar8[0x15] = 0xbf800000;
puVar8[0x16] = 0xffffffff;
puVar8[0xd] = uVar3;
/* try { // try from 00a2ac16 to 00a2ac18 has its CatchHandler @ 00a2afbb */
puVar9 = (undefined4 *)(**(code **)(*(int *)pCVar10 + 0xc))();
LAB_00a2ac19:
puVar8[0x16] = *puVar9;
*(undefined4 *)param_1 = 2;
*(undefined4 **)(param_1 + 4) = puVar8;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
goto LAB_00a2a5fb;
}
piVar18 = (int *)&stack0xffffff24;
if (*(int *)(pCVar10 + 0x15f4) == 2) {
piVar7 = (int *)(**(code **)(*(int *)param_3 + 0x590))();
cVar6 = (**(code **)(*piVar7 + 0x168))();
piVar18 = (int *)&stack0xffffff24;
if (cVar6 != '\0') {
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)&local_7c,(CBaseEntity *)param_3,(CBaseEntity *)param_3,
2000.0,0x80,0);
(**(code **)(*(int *)param_3 + 0x478))();
piVar7 = (int *)(**(code **)(*(int *)param_3 + 0x590))();
pVVar16 = (Vector *)(**(code **)(*piVar7 + 0x108))();
CalculateMeleeDamageForce((CTakeDamageInfo *)&local_7c,pVVar16,(Vector *)&local_88,1.0);
CBaseEntity::TakeDamage(pCVar10,(CTakeDamageInfo *)&local_7c);
piVar18 = (int *)&stack0xffffff20;
}
}
}
}
else if ((*(char **)(in_stack_00000010 + 0x7c) == "prop_wall_breakable") ||
(cVar6 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"prop_wall_breakable"),
cVar6 != '\0')) {
/* try { // try from 00a2a9d3 to 00a2aa35 has its CatchHandler @ 00a2af81 */
piVar7 = (int *)(**(code **)(*(int *)param_3 + 0x590))();
pfVar14 = (float *)(**(code **)(*piVar7 + 400))();
if ((in_stack_00000014 == 0) ||
((*(char *)(in_stack_00000014 + 0x37) != '\0' ||
(piVar18 = (int *)&stack0xffffff24,
pfVar14[1] * *(float *)(in_stack_00000014 + 0x1c) +
*pfVar14 * *(float *)(in_stack_00000014 + 0x18) +
pfVar14[2] * *(float *)(in_stack_00000014 + 0x20) < -0.99)))) {
puVar8 = ::operator_new(0x5c);
uVar3 = *(undefined4 *)(param_2 + 0x34);
puVar8[8] = 0;
puVar8[9] = 0;
puVar8[10] = 0;
puVar8[3] = 0;
puVar8[4] = 0;
puVar8[5] = 0;
puVar8[6] = 0;
puVar8[7] = 0;
puVar8[2] = 0;
*(undefined1 *)(puVar8 + 0xc) = 0;
*(undefined1 *)((int)puVar8 + 0x31) = 0;
puVar8[0xb] = 0;
*puVar8 = &PTR__PunchVictim_00d230a8;
puVar8[1] = &PTR__PunchVictim_00d2320c;
puVar8[0xe] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0xf] = 0;
puVar8[0x10] = 0xbf800000;
puVar8[0x11] = &PTR_NetworkStateChanged_00c23e10;
puVar8[0x12] = 0xbf800000;
puVar8[0x13] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0x14] = 0;
puVar8[0x15] = 0xbf800000;
puVar8[0x16] = 0xffffffff;
puVar8[0xd] = uVar3;
/* try { // try from 00a2aae0 to 00a2aae2 has its CatchHandler @ 00a2afc2 */
puVar9 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0xc))();
LAB_00a2aae3:
puVar8[0x16] = *puVar9;
*(undefined4 *)param_1 = 2;
*(undefined4 **)(param_1 + 4) = puVar8;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
piVar7 = (int *)&stack0xffffff24;
goto LAB_00a2a5fb;
}
}
else {
cVar6 = IsBreakableEntity(in_stack_00000010,false,true,(CTakeDamageInfo *)0x0);
piVar18 = (int *)&stack0xffffff24;
if (cVar6 != '\0') {
piVar7 = (int *)(**(code **)(*(int *)param_3 + 0x590))();
cVar6 = (**(code **)(*piVar7 + 0x168))();
if ((cVar6 == '\0') &&
(cVar6 = CBaseEntity::IsAIWalkable(in_stack_00000010), piVar18 = (int *)&stack0xffffff24,
cVar6 != '\0')) goto LAB_00a2a5e0;
piVar7 = (int *)(**(code **)(*(int *)param_3 + 0x590))();
cVar6 = (**(code **)(*piVar7 + 0x168))();
fVar19 = 0.0;
if (cVar6 == '\0') {
fVar19 = 0.9;
}
(**(code **)(*(int *)param_3 + 0x24c))();
if (((in_stack_00000014 == 0) || (*(char *)(in_stack_00000014 + 0x37) != '\0')) ||
(piVar18 = (int *)&stack0xffffff24,
*(float *)(in_stack_00000014 + 0x1c) * local_78 +
*(float *)(in_stack_00000014 + 0x18) * local_7c +
*(float *)(in_stack_00000014 + 0x20) * local_74 < -fVar19)) {
puVar8 = ::operator_new(0x5c);
uVar3 = *(undefined4 *)(param_2 + 0x34);
puVar8[8] = 0;
puVar8[9] = 0;
puVar8[10] = 0;
puVar8[3] = 0;
puVar8[4] = 0;
puVar8[5] = 0;
puVar8[6] = 0;
puVar8[7] = 0;
puVar8[2] = 0;
*(undefined1 *)(puVar8 + 0xc) = 0;
*(undefined1 *)((int)puVar8 + 0x31) = 0;
puVar8[0xb] = 0;
*puVar8 = &PTR__PunchVictim_00d230a8;
puVar8[1] = &PTR__PunchVictim_00d2320c;
puVar8[0xe] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0xf] = 0;
puVar8[0x10] = 0xbf800000;
puVar8[0x11] = &PTR_NetworkStateChanged_00c23e10;
puVar8[0x12] = 0xbf800000;
puVar8[0x13] = &PTR_NetworkStateChanged_00c0b6e0;
puVar8[0x14] = 0;
puVar8[0x15] = 0xbf800000;
puVar8[0x16] = 0xffffffff;
puVar8[0xd] = uVar3;
/* try { // try from 00a2a55d to 00a2a55f has its CatchHandler @ 00a2afa7 */
puVar9 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0xc))();
goto LAB_00a2aae3;
}
}
}
iVar12 = *(int *)in_stack_00000010;
*piVar18 = (int)in_stack_00000010;
pcVar4 = *(code **)(iVar12 + 0x16c);
piVar18[-1] = 0xa2a6d1;
cVar6 = (*pcVar4)();
if (cVar6 != '\0') {
iVar12 = *(int *)in_stack_00000010;
*piVar18 = (int)in_stack_00000010;
pcVar4 = *(code **)(iVar12 + 0x16c);
piVar18[-1] = 0xa2a6e4;
cVar6 = (*pcVar4)();
pCVar10 = (CBaseEntity *)0x0;
if (cVar6 != '\0') {
pCVar10 = in_stack_00000010;
}
uVar5 = *(uint *)(*(int *)(param_2 + 0x34) + 0x34);
if (((uVar5 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar11 + 8) == uVar5 >> 0xc &&
(piVar7 = *(int **)(puVar11 + 4), piVar7 != (int *)0x0)))) {
iVar12 = *piVar7;
*piVar18 = (int)piVar7;
pcVar4 = *(code **)(iVar12 + 0x16c);
piVar18[-1] = 0xa2a73c;
cVar6 = (*pcVar4)();
if (cVar6 != '\0') {
*piVar18 = (int)pCVar10;
piVar18[-1] = 0xa2a74c;
iVar12 = CBaseEntity::GetTeamNumber((CBaseEntity *)*piVar18);
*piVar18 = iVar12;
piVar18[-1] = 0xa2a754;
cVar6 = IsASurvivorTeam(iVar12);
if (cVar6 != '\0') {
iVar12 = *piVar7;
*piVar18 = (int)piVar7;
pcVar4 = *(code **)(iVar12 + 0x16c);
piVar18[-1] = 0xa2a767;
cVar6 = (*pcVar4)();
piVar15 = (int *)0x0;
if (cVar6 != '\0') {
piVar15 = piVar7;
}
iVar12 = *piVar15;
*piVar18 = (int)piVar15;
pcVar4 = *(code **)(iVar12 + 0x550);
piVar18[-1] = 0xa2a779;
cVar6 = (*pcVar4)();
if (cVar6 != '\0') {
if (piVar7[0xc] == 0) {
iVar12 = 0;
}
else {
iVar12 = piVar7[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
}
if (*(int *)(pCVar10 + 0x30) == 0) {
iVar13 = 0;
}
else {
iVar13 = *(int *)(pCVar10 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
if (iVar12 != iVar13) {
*piVar18 = (int)pCVar10;
piVar18[-1] = 0xa2a7be;
cVar6 = CTerrorPlayer::IsAbleToMove((CTerrorPlayer *)*piVar18);
if (cVar6 != '\0') {
if (((byte)param_3[0x14d] & 8) != 0) {
*piVar18 = (int)param_3;
/* try { // try from 00a2adfc to 00a2af50 has its CatchHandler @ 00a2af81 */
piVar18[-1] = 0xa2ae01;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar18);
}
if (((byte)pCVar10[0x14d] & 8) != 0) {
*piVar18 = (int)pCVar10;
piVar18[-1] = 0xa2a7f1;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar18);
}
local_88 = *(float *)(pCVar10 + 0x2e0) - *(float *)(param_3 + 0x2e0);
local_84 = *(float *)(pCVar10 + 0x2e4) - *(float *)(param_3 + 0x2e4);
local_80 = *(float *)(pCVar10 + 0x2e8) - *(float *)(param_3 + 0x2e8);
*piVar18 = (int)&local_88;
piVar18[-1] = 0xa2a844;
VectorNormalize((Vector *)*piVar18);
local_80 = local_80 + 0.33;
local_74 = *(float *)(ZombiePushAwayForce._28_4_ + 0x2c);
local_7c = local_88 * local_74;
local_78 = local_84 * local_74;
local_74 = local_80 * local_74;
if (((byte)pCVar10[0x14d] & 0x10) != 0) {
*piVar18 = (int)pCVar10;
piVar18[-1] = 0xa2ae18;
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)*piVar18);
}
fVar19 = *(float *)(pCVar10 + 0x274);
fVar21 = *(float *)(pCVar10 + 0x278);
local_7c = local_7c + fVar19;
fVar2 = *(float *)(pCVar10 + 0x27c);
*piVar18 = (int)&local_7c;
local_78 = local_78 + fVar21;
local_74 = local_74 + fVar2;
fVar21 = SQRT(fVar21 * fVar21 + fVar19 * fVar19 + fVar2 * fVar2);
piVar18[-1] = 0xa2a924;
lVar20 = (longdouble)VectorNormalize((Vector *)*piVar18);
fVar19 = (float)lVar20;
*piVar18 = (int)pCVar10;
if (220.0 <= fVar19) {
fVar19 = 220.0;
}
if (fVar19 <= fVar21) {
fVar19 = fVar21;
}
piVar18[1] = (int)&local_7c;
local_7c = local_7c * fVar19;
local_78 = local_78 * fVar19;
local_74 = fVar19 * local_74;
piVar18[-1] = 0xa2a97a;
CBaseEntity::SetAbsVelocity((CBaseEntity *)*piVar18,(Vector *)piVar18[1]);
goto LAB_00a2a5e0;
}
}
}
}
}
}
*piVar18 = (int)pCVar10;
/* try { // try from 00a2ab0b to 00a2ab6b has its CatchHandler @ 00a2af81 */
piVar18[-1] = 0xa2ab10;
iVar12 = CBaseEntity::GetTeamNumber((CBaseEntity *)*piVar18);
if (iVar12 == 2) {
*piVar18 = (int)pCVar10;
piVar18[-1] = 0xa2ab21;
cVar6 = InfectedAttack::IsValidEnemy((CBaseEntity *)*piVar18);
if (cVar6 != '\0') {
iVar12 = *(int *)(param_2 + 0x34);
if (pCVar10 == (CBaseEntity *)0x0) {
*(undefined4 *)(iVar12 + 0x34) = 0xffffffff;
}
else {
iVar13 = *(int *)pCVar10;
*piVar18 = (int)pCVar10;
pcVar4 = *(code **)(iVar13 + 0xc);
piVar18[-1] = 0xa2ab3f;
puVar8 = (undefined4 *)(*pcVar4)();
*(undefined4 *)(iVar12 + 0x34) = *puVar8;
}
}
}
}
}
LAB_00a2a5e0:
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
piVar7 = piVar18;
LAB_00a2a5fb:
iVar12 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
piVar7[-1] = 0xa2a98b;
iVar13 = ThreadGetCurrentId();
if (iVar12 == iVar13) {
*piVar7 = (int)_DAT_0105d15c;
piVar7[-1] = 0xa2a9a0;
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (iVar17 != 0) {
piVar7[5] = 0;
piVar7[4] = 0;
piVar7[3] = 0;
*piVar7 = iVar17;
piVar7[1] = 0;
piVar7[2] = 0;
pcVar4 = *(code **)(iVar17 + 0x54);
piVar7[-1] = 0xa2a651;
(*pcVar4)();
}
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.