ZombieBotLocomotion::DetectCollision
0x00a52b70 · 1526 bytes · __thiscall
_ZN19ZombieBotLocomotion15DetectCollisionEP10CGameTraceRiRK6VectorS5_S5_S5_
Decompiled
undefined (7 params)
/* ZombieBotLocomotion::DetectCollision(CGameTrace*, int&, Vector const&, Vector const&, Vector
const&, Vector const&) */
undefined4 __thiscall
ZombieBotLocomotion::DetectCollision
(ZombieBotLocomotion *this,CGameTrace *param_1,int *param_2,Vector *param_3,
Vector *param_4,Vector *param_5,Vector *param_6)
{
float fVar1;
uint uVar2;
code *pcVar3;
CBaseEntity *pCVar4;
char cVar5;
undefined *puVar6;
int *piVar7;
undefined4 uVar8;
int *piVar9;
int *piVar10;
CBaseEntity *pCVar11;
CBaseEntity *pCVar12;
Vector *pVVar13;
int iVar14;
IHandleEntity *pIVar15;
longdouble lVar16;
undefined **local_8c [4];
float local_7c;
float local_78;
float local_74;
float local_6c;
float local_68;
float local_64;
float local_5c;
float local_58;
float local_54;
float local_4c;
float local_48;
float local_44;
undefined4 local_3c;
undefined1 local_38;
undefined1 local_37;
lVar16 = (longdouble)CountdownTimer::Now();
pIVar15 = (IHandleEntity *)0x0;
if (((((float)lVar16 < *(float *)(this + 0x148)) &&
(uVar2 = *(uint *)(this + 0x14c), uVar2 != 0xffffffff)) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
pIVar15 = *(IHandleEntity **)(puVar6 + 4);
}
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_8c,pIVar15,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
local_8c[0] = &PTR_ShouldHitEntity_00d28be8;
piVar7 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
piVar7 = (int *)(**(code **)(*piVar7 + 0xc4))(piVar7);
uVar8 = (**(code **)(*piVar7 + 0x130))(piVar7);
local_3c = 0;
local_6c = *(float *)param_4 - *(float *)param_3;
local_68 = *(float *)(param_4 + 4) - *(float *)(param_3 + 4);
local_64 = *(float *)(param_4 + 8) - *(float *)(param_3 + 8);
local_37 = local_68 * local_68 + local_6c * local_6c + local_64 * local_64 != 0.0;
local_4c = (*(float *)param_6 - *(float *)param_5) * 0.5;
local_5c = (*(float *)param_6 + *(float *)param_5) * 0.5;
local_58 = (*(float *)(param_6 + 4) + *(float *)(param_5 + 4)) * 0.5;
local_48 = (*(float *)(param_6 + 4) - *(float *)(param_5 + 4)) * 0.5;
local_44 = (*(float *)(param_6 + 8) - *(float *)(param_5 + 8)) * 0.5;
local_54 = (*(float *)(param_6 + 8) + *(float *)(param_5 + 8)) * 0.5;
local_7c = *(float *)param_3 + local_5c;
local_74 = *(float *)(param_3 + 8) + local_54;
local_38 = local_48 * local_48 + local_4c * local_4c + local_44 * local_44 < 1e-06;
local_78 = *(float *)(param_3 + 4) + local_58;
local_5c = -local_5c;
local_58 = -local_58;
local_54 = -local_54;
(**(code **)(*enginetrace + 0x14))
(enginetrace,(CTakeDamageInfo *)&local_7c,uVar8,(CTraceFilterSimple *)local_8c,param_1);
if ((*(float *)(param_1 + 0x2c) <= 1.0 && *(float *)(param_1 + 0x2c) != 1.0) ||
(param_1[0x36] != (CGameTrace)0x0)) {
cVar5 = CGameTrace::DidHitNonWorldEntity(param_1);
}
else {
if (param_1[0x37] == (CGameTrace)0x0) {
return 0;
}
cVar5 = CGameTrace::DidHitNonWorldEntity(param_1);
}
if (((cVar5 != '\0') && (pCVar4 = *(CBaseEntity **)(param_1 + 0x4c), pCVar4 != (CBaseEntity *)0x0)
) && ((iVar14 = (**(code **)(*(int *)pCVar4 + 0x144))(pCVar4), iVar14 == 0 &&
((cVar5 = (**(code **)(*(int *)this + 0x164))(this,pCVar4,0), cVar5 != '\0' &&
(uVar8 = IsFlimsy(pCVar4), (char)uVar8 != '\0')))))) {
if (*param_2 < 1) {
return uVar8;
}
*param_2 = *param_2 + -1;
piVar7 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
pCVar11 = (CBaseEntity *)(**(code **)(*piVar7 + 0xb4))(piVar7);
piVar7 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
pCVar12 = (CBaseEntity *)(**(code **)(*piVar7 + 0xb4))(piVar7);
CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c,pCVar12,pCVar11,100.0,1,0);
pVVar13 = (Vector *)(**(code **)(*(int *)this + 0x14c))(this);
CalculateExplosiveDamageForce
((CTakeDamageInfo *)&local_7c,pVVar13,(Vector *)(param_1 + 0xc),1.0);
CBaseEntity::TakeDamage(pCVar4,(CTakeDamageInfo *)&local_7c);
uVar8 = DetectCollision(this,param_1,param_2,param_3,param_4,param_5,param_6);
return uVar8;
}
piVar9 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
cVar5 = (**(code **)(*piVar9 + 0xf4))(piVar9,*(undefined4 *)(param_1 + 0x4c));
if (cVar5 != '\0') {
piVar9 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
(**(code **)(*piVar9 + 0x1c))(piVar9,*(undefined4 *)(param_1 + 0x4c),param_1);
}
piVar9 = *(int **)(param_1 + 0x4c);
if ((piVar9 != (int *)0x0) &&
(piVar10 = (int *)__dynamic_cast(piVar9,&CBaseEntity::typeinfo,&INextBot::typeinfo,0xfffffffe),
piVar10 != (int *)0x0)) {
cVar5 = (**(code **)(*piVar10 + 0xf4))(piVar10,*(undefined4 *)(this + 0x78));
if (cVar5 != '\0') {
(**(code **)(*piVar10 + 0x1c))(piVar10,*(undefined4 *)(this + 0x78),0);
goto LAB_00a52ea2;
}
piVar9 = *(int **)(param_1 + 0x4c);
}
pcVar3 = *(code **)(*piVar9 + 0x1b4);
piVar9 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
uVar8 = (**(code **)(*piVar9 + 0xb4))(piVar9);
(*pcVar3)(*(undefined4 *)(param_1 + 0x4c),uVar8);
LAB_00a52ea2:
cVar5 = (**(code **)(*piVar7 + 0xe8))(piVar7,2);
if ((cVar5 != '\0') &&
(cVar5 = (**(code **)(**(int **)(param_1 + 0x4c) + 0x16c))(*(int **)(param_1 + 0x4c)),
cVar5 != '\0')) {
iVar14 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(param_1 + 0x4c));
uVar8 = IsASurvivorTeam(iVar14);
if (((char)uVar8 != '\0') && (*(char *)(*(int *)(param_1 + 0x4c) + 0x186) == '\t')) {
iVar14 = (**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
(*(int *)(this + 0x78) + 0x1a3c);
pCVar4 = *(CBaseEntity **)(param_1 + 0x4c);
fVar1 = *(float *)(iVar14 + 8);
if (((byte)pCVar4[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar4);
}
if (fVar1 - *(float *)(pCVar4 + 0x2e8) <= 0.0) {
return uVar8;
}
CBaseEntity::SetMoveType(*(CBaseEntity **)(param_1 + 0x4c),2,0);
return uVar8;
}
}
return 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.